Problem Import Modules in the Python IDE

Really, I'm a little tired of this, so I hope you can help me figure it out once and for all.

I am really confused about what is happening with Python on my MacBook. I am running OS X 10.6.2 and installed python from a website (a package that includes IDLE). This works absolutely fine, and in fact IDLE will run everything I want, I just don’t want to use IDLE.

So, I tried Netbeans and it infuriates - it seems he is looking for libraries in a completely wrong place (even when I try to get it to look in different places on Python on my machine). Eclipse did something very similar.

This leads to more problems; How to install modules in python exactly? -Using MacPorts, it seems to disappear in some depths of opt / local / var / macports, where it is detected by nothing but IDLE. -The "python setup.py install" luck from the USUALLY command line ends with various errors regarding something like:

warning: in /opt/local/lib/libfreetype.dylib, file is not of required architecture 

and then sometimes unloads something in Libraries \ Python \ 2.6 \ site-packages, which doesn't work. - Installing a version of any module in .dmg format literally seems to be doing nothing, cannot find any trace of what she did to him, even from IDLE.

There seems to be different versions of Python running on my machine, with different IDEs that are looking for different places for Python and its modules. As it seems, each way to install modules for python puts them in different places. Is it really that hard?

Is there a way to get Netbeans to run a specific version of python? Or is there a way to force everyone to use only one of the versions? Also, which paths belong to Python versions?

Yours, seriously embarrassed!

Duncan

+4
source share
1 answer

I understand this by sticking to the Python installation for macros. For compatibility reasons, I am very afraid of mixing modules for different versions of python.

Using python_select , port installed modules and macports easy_install version should ensure that everything is found. In rare cases, you may need to trick sys.path , but this should only be for third-party things that don't have a better installer.

This solution is not ideal, but for me it is normal. Just make sure you reconfigure your editor to point to the correct interpreter if you run your programs this way. If you need to distribute your software (and cannot get into the ports directory), you can always create a configuration tool designed to install native python.

0
source

Source: https://habr.com/ru/post/1301593/


All Articles