I have problem with new created project with PyCharm community 2019.3.
After creating new enviroment with fresh python 3.7 interpreter, the interpreter path in terminal is still related do the linux system path:
(venv) *#*:~/PycharmProjects/test$ python
import sys
sys.executable
--> /usr/bin/python3.7
instead of:
/home/*/PycharmProjects/test/venv/bin/python
but if i check the interpreter path in Pycharm python console then i get proper result.
In project settings Project interpreter path is:
Python3.7 (test) ~/PycharmProjects/test/venv/bin/python
PATH for this interpreter are:
/home/*/PycharmProjects/test/venv/lib/python3.7/site-packages
/usr/bin/python3.7
After creating new venv with python 3.7 and after activate it, problem remains:
echo $PATH
/home/*/PycharmProjects/test/venv2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PATH is ok /home/*/PycharmProjects/test/venv2/bin but interpreter is from /usr/bin/python3.7.
Question How to correct this issue?
On JetBrains link
Turns out that Pycharm v2019.3 Terminal PATH is bugged. The issue is not occur in previous versions.
Related
I have installed python 3.7.9 and 3.10.1. I have one virtual environment say(test). I have set up pycharm project interpreter as 3.7.9. But in the pycharm terminal, it is showing as 3.10.1, while in the interpreter it is 3.7.9. How to make them the same?
I am using Ubuntu 18.10(dual Boot win10), I have installed anaconda (conda version- 4.6.7) on ubuntu. After this Installation I installed Pycharm via snap on Command Prompt. Since Pycharm(version - 2018.3.5) didnt Detect my python Location automatically I set the python Interpreter via
Adding Location ->System Interpreter (As I didn't want any Venv) -> Path
But when I try to import opencv in Pycharm it says
ModuleNotFoundError: No module named 'cv2'
Python3.6 in Anaconda Bin is shown to which I have linked in Pycharm (I have also tried other Python files there as well but no luck)
When I run in Terminal: python3 -c 'import sys; print(sys.path)'
It shows:
['', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6
/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/local
/lib/python3.6/dist-packages/setuptools-39.1.0-py3.6.egg', '/usr/lib`/python3
/dist-packages']
So could anyone help me out in this?? Thank You in Advance!!
Edit 1:
I am also unable to access any of the libraries from terminal Itself. So Could anyone help me with that as well. Should I export path of this Python in Anaconda bin folder to bashrc file in Ubuntu?
Edit 2:
The libraries affected is not just opencv. There are few other Libraries like Portaudio which are affected as well along with Opencv
hello I'm new to python3 and python3.6, I usually use pip3 install to add old libraries to my python3 path.
I recently picked up python3.6 for managing my home servers with its asyncio functionalities however my python3.6 interpreter is unable to locate pwnlibs and am thus unable to reuse my old code.
I tried:
import sys
import os
sys.path.append(os.path.abspath(pwn.__file__))
import pwn
debugging results:
on python3.4 os.path.abspath(pwn.__file__) returns the correct path to the library
While sys.path.append is a valid means to add to your python path at runtime, you can't get the path from a module you have not yet loaded.
Instead you should install your packages using pip3 or in a specific location and add that to your path either at runtime or via the PYTHONPATH environment variable.
I would guess since you mentioned pip3 already however that you had the pwn package already installed when you tried with 3.4 and your install of Python 3.6 is not using the same paths as your Python 3.4 install. Try comparing your python paths from 3.4 with 3.6 by comparing the output from sys.path.
Lastly, just as a note, if you are using the pwntools package, it doesn't yet support Python 3, so if you are simply copying the folder, be aware it might not function correctly or at all.
Where am I going wrong about with Pygame in PyCharm??
1 I have installed Pycharm and its works
2 I have installed Python and Pygame. I have ran "python -m pygame.examples.aliens" in the cmd and the game loads.
3 I have anaconda3 on my computer and that works i.e. you can use the files in the library
4 When I go to Pycharm and type "import pygame" I get an error line
5 So I try and change the interpreter to where Pygame is located and it does not work.
How do you get Pygame into an interpreter. Or what the hell am I missing.
The package will be available only for the version you've installed, python2 or python3.
It looks like you installed pygame into python2, if this command works in cmd:
python -m pygame.examples.aliens
To check or change the default interpreter used in PyCharm:
-menu File > Build, Execution, Deployment > Console >
Python Console > Python Interpreter
By modifying this you don't change the interpreter in your current projects, you can create a new project to check if Pygame is working now.
In your current projects, you can see what interpreter is enabled, in the top right corner toolbar:
-name of the file > Edit configurations > Python interpreter
Maybe you can install Pygame in Python3 to avoid the issue
I have installed Anaconda on Windows 7 from the full installer and then created an Anaconda Python 3 environment (py3k) using conda. From my reading of the installation instructions at
http://continuum.io/blog/anaconda-python-3
I type activate py3k at the Anaconda command prompt to obtain that environment and in the Command Prompt window it says
[py3k] C:\users.. etc
which would appear to indicate that I am, in fact, in a Python 3.X environment. However, when I type 'Python' at the prompt I get
Python 2.7.5 | Anaconda ... etc
Am I still in a Python 3.X environment or have I omitted to do something installation-wise or otherwise?
have you tried unset PYTHONPATH, and which python?
If you do that after activating py3, you should be able to the python 3 interpreter. If not, what do you get after executing which python?