I am having issues in trying to get the Pydev install in Eclipse to recognise my installed modules such as Beautiful Soup. Within the Preferences > PyDev > Interpreter I have used the Auto Config (which didn't work) and also tried telling Pydev where the Python interpreter is manually. I am on Macosx running Python 2.7.2.
If I import BeautifulSoup within IDLE it works fine. What Eclipse doesn't seem to do is load the site-packages. Going back to the auto-config it loads user/bin/python as the Interpreter and my system path consists of these:
I have tried reinstalling Eclipse, following several tutorials on Youtube and also following other peoples solutions with no success. Can anyone help? Thanks.
When you press the auto-config or add a new interpreter, it'll show a dialog with all the paths it found to be in the PYTHONPATH, but some are not checked by default (it only leaves checked what it believes to be common to all projects -- i.e.: under the python installation), so, try checking if the site-packages appear at that dialog and check it if it's there...
Also, I remember that MacOS has an issue in which it doesn't ship source files for the libraries, so, that may be an issue too (in which case I'd recommend installing a Python version from python.org instead of using the one that comes pre-installed in MacOS).
Try to change proxy settings of eclipse.
Select Active Provider to "Manual". Set HTTP/HTTPS proxy. Clear SOCKS proxy if this is set.(select SOCKS proxy raw and click "Clear" button) Restart Eclipse to apply these settings.
Related
If I do something like "import selenium" (or any other kind of third party library) in a .py file and then run it from the terminal, it works just fine. But if I make a new file in PyCharm CE and do the same thing, it can't find the library / module.
How can I fix this or get it to point in the right location? I use a Macbook Pro.
You need to setup your project in PyCharm to use the Python interpreter that has your libraries:
Go to: file->settings->project->project interpreter
And select the appropriate interpreter from the dropdown. After selecting an interpreter, the window displays a list of libraries installed on that interpreter; this should further help you make the right selection.
I've faced a similar issue on Pop!_OS after installing PyCharm via Flatpak. I think the installation is somehow incomplete, as I've had these issues (among others):
Installer could not create the menu shortcut due to the lack of credentials. Unlike during a typical installation, it wouldn't ask for the password and instead I had to uncheck that option altogether.
Built-in terminal defaulted to sh. Even after changing to bash, it would not read my .bashrc and many commands were missing.
After changing the interpreter into a local virtualenv, it would just default to Python 3.7 (even though the version was actually 3.8) and it didn't see any of my installed libraries.
When I've tried to use a Docker Compose environment, IDE failed to detect Docker Compose installation.
I've eventually uninstalled PyCharm and downloaded it directly from Jetbrains website to make it work correctly.
I'm new to programming and just started a course on Python. I want to use PyCharm, so I downloaded and intalled it (v. 4.5, community edition). I had previously installed Python 3.5 64-bit from python.org (I'm using Windows 10).
To start using PyCharm, I need a project interpreter, which I can select in the settings. As far as I'm concerned, the interpreter is "py.exe", but when I select it, I get this error message: "The selected file is not a valid home for Python SDK". I also tried to use every file whose name contained "python" or "py", and failed.
On every website and video I see, they select a file called "python.exe", but they're using Python 3.4 or a previous version. I checked that PyCharm supports 3.5 ("Initial support for Python 3.5").
Is there anything I'm doing wrong? What should I do to be able to use PyCharm?
All replies are appreciated. Thanks in advance.
file > new project settings > project Interpreter > click in the drop down and select 'show all' > click the '+' button >
Now, in the Virtualenv Environment tab under the New environment radio button, check the path in the 'Base interpreter:' field. For me, mine was set to an invalid path. Once I had corrected the path to point to python.exe I recreated my new project and PyCharm built the virtualenv.
For me there was a bit more too.... When creating the new project I expanded the drop down and had to verify the directory where the venv directory was being created. Once I had corrected the path here I had to click around a bit to get it to let me create the project.
I'm going to chaulk this up to a bug. I'm using Community edition.
When creating a project in PyCharm, if the interpret is not already selected, in the drop down menu under the projects "Location:", you can click the gear-looking icon to the right of the interpreter option, and click "Add Local"; then select the file location of the python.exe file that you have installed. It will probably be C:\Python35\Python.exe
I faced a Similar issue and was not able to find Python interpreter anywhere on the system.
The problem with it was that python was installed directly with default settings and there was no exe found in
C:\Python35\
and to solve this i tried uninstalling and reinstalling with custom settings and selecting allow for all users as well which did the trick and path was set correctly to
C:\Python35\python.exe.
After whichPycharm was able to detect the interpreter on this path.
PyCharm project interpreter problem Resolved
I installed anaconda python distribution (Anaconda3-5.0.1-Windows-x86_64.exe) from the anaconda website. https://anaconda.org/anaconda/python
What it actually did was it re-installed my Python3.6.3 (pertinent to mention I have windows10, with pyCharm community & python 3.5 already but with the interpreter problem and while installing anaconda I chose the following settings and disabled my antivirus before my anaconda installation):
selecting allow for all users
installation path was set correctly and (stored safely for future)
restart my Computer after installation.(not essential-but I did)
opened Anaconda & Jet brian pycharm
selected new project in PyCharm screen shot of my New project default Python interpreter location = C:\Users\Skboy\PycharmProjects\dani Interpreter = C:\Users\Skboy\AppData\Local\Programs\Python\Python36-32\python.exe
Wow! my pyCharm started working for me,
Resolution : Python6.3 re-installation with proper custom setting
make a python test test1.py program file to print "hello python test world"
Run
now my Python Interpreter(automatically -by default select) Python 3.6.3
edit configuration & check for interpreter
(C:\Users\user1\AppData\Local\Programs\Python\Python36-32\python.exe)
Run
success test Run
worth to mention Anaconda Jupyter is a web based can also be used in case novice user are still having problems
I have had the exact same problem and was unable to find the solution until just now. Hopefully this works for anyone that was struggling with it.
I went to the location of the Python 3.5 (32-Bit) in my C: Drive which it turns out is just a shortcut to the actual Python application, right click on it and select Open file location which should direct you to the application version of python - simply called 'python'. This is the .exe file that PyCharm was looking for to use as the interpreter.
Now go to the configure interpreter menu in Pycharm and type in the file location of the actual python application. To get to mine I had to go to AppData/Local/Programs/Python/Python35-32. Click on the python.exe file and it should work.
This is my first post here so if its formatted incorrectly or doesn't use the conventional terms - sorry. Let me know if the solution worked for anyone else with the problem or if I fluked it.
If you kept the default settings while installing python, Your project interpreter for PyCharm will be:
C:\Users\yourUserName\AppData\Local\Programs\Python\Python36\python.exe
Chose the above location as your project interpreter inside PyCharm.
Depending on which python version you have, it could be either Python36\python.exe or Python35\python.exe.
For me the following solution it worked:
My configuration:
Pycharm Community edition 2019.1.1
Anaconda distribution with python 3.7. Interpreter in standard location.
Problem:
Pycharm was not able to find python interpreter after reinstallation of anaconda distribution.
Solution:
- Make sure you run pycharm as admin (right click and run as admin). This was actually the critical step.
- Create new project (or open an existing one)
- Depending on the choice choose interpter or go to file > settings > project interpreter > choose small gear on rights side > add > on base interpreter choose the 3 dots > paste the location of the interpreter in the anaconda distribution.
Hope it helped someone. For me the blocking point was that for some reason pycharm was not launching with admin rights.
Blockquote
I'm running a Django project from PyCharm with the configuration set up to use the Python interpreter from a virtualenv which has a dependency on opencv. The site works fine locally when I run django-admin.py runserver, however I keep getting an "ImportError: No module named cv2" error when I try to run the project directly from the PyCharm IDE.
Has anyone else had this issue with PyCharm and opencv?
In the end I ended up having to set an environment variable directly in the Pycharm Edit Configurations -> Run/Debug Configurations -> Environment Variables panel. I added the following option after you hit the edit button: set name to PYTHONPATH and value to /usr/local/lib/python2.7/site-packages:$PYTHONPATH which should display in the input box after editing as PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH. Also, I made sure to log out and log back in of osx which also worked for a couple other path related issues.
I'm not quite sure if this works for you guys but it works for me. In my case, it seems to me that I installed OpenCV to work with the default Python arriving with OS X. I remember I tried to install Python 2.7.5 and Python 3 in my Mac as well, I see them when I chose my Python interpreter for Pycharm. And all of them didn't let me import module cv2. So I change to the default Python2.7.2 (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python). Then, in File/DefaultSettings/Project Interpreter/Python Interpreter, click on the Python interpreter that's been added (Python 2.7.2), click on Paths and locate to "/usr/local/bin/python2.7/site-packages"and add it. Click the blue refresh button, apply and ok. Then it works, both with import and autocompletion.
Regards,
I am trying to import the OpenGL.GL module.
Given the py file with that line, I can perform "python file.py" just fine, but I cannot run that same file when used in Aptana or Eclipse. Both IDEs have PyDev installed.
I do have PyOpenGL installed.
I wish to point out that I can still import other modules (PIL, numpy), which were installed the same way as the PyOpenGL. I am confident that there is only 1 python running on my MacOS.
I had the same problem after installing a different version of PyOpen and my Eclipse PyDev path is messed up. What I did was remove the interpreter link and re-added the old one which made PyDev to re-scan my libs. This seems to fix the problem. Don't forget for all your projects, you need to go to the property (Right click project->properties) and re-select the interpreter.
Maybe you need to reconfigure your interpreter.
If you installed PyOpenGL as an egg after pydev was set up your PYTHONPATH might be out of date.
Check out Preferences->PyDev->Interpreter - Python
Are you sure you don't have multiple versions of python? Seems to me like the interpreter that aptana uses is not the same as the one used from command line. You can look in:
Run -> Run configurations -> Python run -- then you have Interpreter tab
There you can click : See resulting command line. Than will get you the python that is used as well as the python path
i'm using Elcipse+PyDev and Pyscripter sometimes for Python 2.7
Yesterday i installed PyTables from compiled binaries and :
import tables
h5f = tables.openFile(r'D:\sample.h5','w')
h5f.createGroup('/','Box')
h5f.
So, when I type "h5f." IDE don't show me all the methods, only a few!
Can't do anything with It, installed PyTables few times,same result...
Method h5f.CreateGroup() works perfectly, but IDE dont see it so don't display it in drop-down list! Eclipse and Python both behave same...
The thing with Pydev and Eclipse is that when you install a new package or library and if you want to use the auto-complete with it, you will have to recreate the system PYTHONPATH in eclipse.
For that go to: Window -> Preferences -> Pydev -> Interpreted Python and in the tab libraries, in System PYTHONPATH you will not see your new installed library because pydev just do a copy of the PYTHONPATH the first time that you have configured and now each time you installed a new package you will have to resynchronize pydev with the new PYTHONPATH.
So to resynchronize you will have to click on the button Apply so that eclipse export (again) all the library (between them your new installed one) from PYTHONPATH to eclipse.
So now eclipse should know your library and you should work with it just fine.
Hope this will help :)