Виртуальная среда
С виртуальными средами вы защищаете свой код от системы, устанавливаете любые пакеты и версии в своей среде.
Yes, it does matter. Pip uses Python, but since Ubuntu comes pre-installed with a version of Python (In your case both 2 and 3 are installed), you shouldn’t have to worry about this. But the order would be Python -> PIP -> virtualenv. Once youcd
in a new, empty project folder, you can create the virtualenv with the Python version of your choice withvirtualenv -p /path/to/python/version venv
. You can find the path withwhich python2
orwhich python3
. If I understand your question correctly — yes. The whole point of virtualenv is to keep each project in a separate folder with its own virtualenv set up. Even with a small project, you will just become more familiar with the concept of virtualenv (and maybe even containers like Docker). __HoppyKamper
Затем вы можете войти в среду, найдя ее файл активации (например, я создаю среду, чтобы поиграть с keras)
source ~/keras-env/bin/activate
На окнах
source `pwd`/<env_name>/bin/activate
Используйте Jupyter Notebook в своей среде
This worked for me in windows 10 and latest solution : 1) Go inside that conda environment ( activate your_env_name ) 2) conda install -n your_env_name ipykernel 3) python -m ipykernel install — user — name build_central — display-name “your_env_name” (NOTE : Don’t ignore those semicolons at “your_env_name”, in step 3) It doesn't need to be conda, you can create an enviroment similar to above and use it. __bad programmer
Теперь каждый раз, когда я открываю Jupyer Notebook, я могу выбрать среду для работы и сохранить каждый проект отдельно и без ошибок.