So I have two sitepackage folders:
Under: /Library/Python/2.6/site-packages
Under: /Library/Python/2.6/site-packages /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
Every time I do sudo easy_install module, Python installs it in (1). Every time I try to import it from (1), Python can't find it.
Every time I move that module with copy and paste to (2), Python can find it.
Is there an elegant/regular way to make Python install it in the correct sitepackages?
site-packages is the target directory of manually built Python packages. When you build and install Python packages from source (using distutils, probably by executing python setup.py install ), you will find the installed modules in site-packages by default.
Default value is ~/. local/lib/pythonX.Y/site-packages for UNIX and non-framework macOS builds, ~/Library/Python/X.Y/lib/python/site-packages for macOS framework builds, and %APPDATA%\Python\PythonXY\site-packages on Windows.
First, we create a directory and give it a package name, preferably related to its operation. Then we put the classes and the required functions in it. Finally we create an __init__.py file inside the directory, to let Python know that the directory is a package.
Add /Library/Python/2.6/site-packages
to your PYTHONPATH
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With