I am learning how to use TensorFlow, so I installed Anaconda and then, as instructed, created a virtual environment, via
conda create -n tensorflow
source activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py3-none-any.whl
And proceeded to validate that everything was installed successfully. Now I want to use this virtual env in Pycharm, so I go to preferences -> Interpreter -> Add local, and go to what I assume is the correct file to point to, /Users/myusername/anaconda/envs/tensorflow/bin/conda, but I get an error message,
The selected file is not a valid home for Python SDK.
What am I doing wrong? Is it another file I should be pointing to? how do I use the virtual env
The interpreter should be pointing to python instead of conda. For example, the interpreter should be
/Users/myusername/anaconda/envs/tensorflow/bin/python
Related
Hi I just installed conda.
When I open my terminal and type 'jupyter notebook', it automatically open it with conda environment.
I want to know if it is possible to open it in a non-conda environment? (that's to say, conda is now set as default when I open it, right?)
Thank you very much.
enter image description here
Conda is default environment for you now. For change
First activate the conda environment from the command line, then launch the notebook server.
For example:
$ source activate env_name
$ jupyter notebook
You can find more information in here
You most likely enabled auto activation of the conda environment during installation. Take a look at How do I prevent Conda from activating the base environment by default? to disable it (most likely via conda config --set auto_activate_base false). Then, you can double check via which python that you're not getting the conda version and install jupyter with your non-conda, system Python environnment - via python -m pip install jupyter.
i'm having a weird problem...
I can install packages using the built-in package manager in pycharm. But for some reason everytime i use "pip install (xx)" it is installing the packages in a conda env somewhere on my mac...
How can i solve this ?
I've tried the following:
close --> reopen pycharm //
deactivate and activate the venv //
Checked project intepreter is the right one (which it is...)
You're inside the virtual environment venv, while being inside the Conda base environment (note the (venv) and (base) to the left of your prompt). Conda is likely overriding your venv's pip.
My bet as to why this is happening is that, during installation, you set Conda to autostart its base environment whenever a new terminal is open (be it inside PyCharm or not).
You can try to either:
exit Conda (with conda deactivate) and try pip install again (check to see that you're still inside the venv virtual environment).
install the packages directly from PyCharm's GUI - note the small + sign on the bottom-left of the package list. This won't solve the issue related to your terminal, but will function as a workaround for now.
Note that these aren't guaranteed to work, because you may have additional configurations on your system (either installed directly by you, or indirectly by Conda when you installed it).
I was wondering How can I stop python from installing modules in specific virtual environment and install them globally;or probably virtaulenv won't let me do that!?
if you have (venv) before you terminal input, your virtual environment is activates. so you can using deactivate command for deactivating. in addition if you have a (base) you should be closing your anaconda base environment so you can see this answer
You simply install the package without activating your virtual environment. Once you install your package that way, it would be installed globally instead of inside a global environment.
Also, to confirm this, you can activate your virtual environment and run the command pip list , this will show all the packages in that virtual environment, and also try deactivating the virtual environment and run the command pip list, this would show all packages in the system.
I hope this answers your question
I believe I've found some sort of solution ,by just typing "pip install -target C:\Users\YOURNAME\AppData\Roaming\Python\Python37\site-packages"
it's kind of a lame solution but I think it's better than nothing!
By the way there was no pip.exe in my python folder!!!
I am fairly new to using virtual environments for python projects but I have spent many hours trying to resolve this issue I've been having through various posts on this site and on others and have come up short. I have even resorted to uninstalling all python distributions and reinstalling with no luck.
I have the anaconda distribution of python installed on Windows 10. I have the problem that after I create a virtual environment, called venv, in a project folder I am unable to then activate this virtual environment using the anaconda prompt to install packages through pip. What I have done so far is as follows:
(base) C:\Users\[User]\Documents\GitHub\[project_folder]> virtualenv venv
This then successfully creates a virtual environment folder in my project folder called venv. Working in this directory I navigate to:
(base) venv> cd Scripts
(base) venv\Scripts> activate
There are a number of activate files to choose from and neither turns the environment from base to env as expected.
The reason I am using anaconda prompt as opposed to the standard command prompt or Windows PowerShell is because when I'm using the pip install <package> anywhere but in the anaconda prompt I get an error message that reads:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
I'm not sure what this means and have tried to do some googling to solve this issue but to no avail. Note I do not have this issue when working on python projects on my MacBook and I can easily enter virtual environments and install the packages there with no issues. I'm relatively new to Windows so perhaps I'm missing something here...?
An interesting observation is that I can enter any virtual environment I've created through Windows PowerShell but I encounter the pip problem described above when trying to install packages into this environment.
I'm desperate for some help resolving this issue as it's greatly hindering the work on all my projects, and unfortunately I cannot just use my MacBook to code either.
use those command for python virtualenv
For activate
WINDOWS: activate nameofvenv
LINUX, macOS: source activate nameofvenv
For deactivate
WINDOWS: deactivate
macOS, LINUX: source deactivate
Whenever I run the commands which conda, which pip, and which python in the base environment, it works fine but whenever I activate the virtual environment using the conda activate command it doesn't recognize those and says no conda/pip in ....
Does anybody have a solution to this? Is this simply a path problem and I need to set a separate path for the virtual environment? Thank you.