I created a new project in PyCharm and I made an environment file for the project. I want to use Jupyter Notebook with that project now and since Jupyter in PyCharm is not as great, I want to launch it from cmd. I am not able to figure out to activate the environment created in PyCharm from the command line. Can anyone help me with that?
Add a comment
|
2 Answers
- find the location of environment from PyCharm's project's interpreter settings
From the terminal Run:
source /path/to/env-activate
2 Comments
Aakaash Jois
I located the path for the environment. But when I run
source path-to-env in cmd, I get an error which says 'source' is not recognized as an internal or external command, operable program or batch file.Aakaash Jois
I think I got it. I took a different approach. I found the
activate.bat. I then dragged and dropped it in cmd and hit Enter. This worked and the environment changed.Solution For Linux
try to use pyenv, once you install virtualenv with pyenv for example
cd ~/your_project_root_folder
pyenv install 3.6.1
pyenv virtualenv 3.6.1 your_venv_name
pyenv local your_venv_name
Then whatever shell command is launched (even from pyenv) you will have correct virtualenv and you don't need to change anything inside pycharm