I don't remember how I originally installed virtualenv
, and apparently none of pip
, pip3
, and brew
are claiming it.
$XXX list | grep virtualenv
But here it does return a directory:
$which - a virtualenv / usr / local / bin / virtualenv
My motivation for this is because virtualenv is pointing to a non-existing / falsely linked interpreter, and I was advised that reinstallation of virtualenv
might mend this problem. Thanks in advance!
$ virtualenv my_venv
-
bash: /usr/local / bin / virtualenv: /usr/local / opt / python3 / bin / python3 .6: bad interpreter: No such file or directory
To make it easier to work on multiple projects that has separate environments you can install virtualenvwrapper. It's an extension to virtualenv and makes it easier to create and delete virtual environments without creating dependency conflicts.,Virtualenv is a tool that lets you create an isolated Python environment for your project. It creates an environment that has its own installation directories, that doesn’t share dependencies with other virtualenv environments (and optionally doesn’t access the globally installed dependencies either). You can even configure what version of Python you want to use for each individual environment. It's very much recommended to use virtualenv when dealing with Python applications.,These commands create a venv/ directory in your project where all dependencies are installed. You need to activate it first though (in every terminal instance where you are working on your project):,Note: virtualenvwrapper keeps all the virtual environments in ~/.virtualenv while virtualenv keeps them in the project directory.
To install virtualenv
run:
pip install virtualenv
If you have a project in a directory called my-project
you can set up
virtualenv
for that project by running:
cd my - project / virtualenv venv
If you want your virtualenv
to also inherit globally installed packages run:
virtualenv venv--system - site - packages
You should see a (venv)
appear at the beginning of your terminal prompt
indicating that you are working inside the virtualenv
. Now when you install
something like this:
pip install <package>
To leave the virtual environment run:
deactivate
Save the list of packages to a requirements file pip freeze > /tmp/requirements.txt ,If you've already got a requirements.txt file, you can skip this bit, although you may want to just do the bit where we double-check what version of Python we're using.,pip freeze > /tmp/requirements.txt,If you need to rebuild your virtualenv following a system image upgrade
Using plain virtualenvs:
rm - rf / home / myusername / path / to / virtualenv
or, if using virtualenvwrapper:
rmvirtualenv my - virtualenv - name
Using the appropriate Python version in place of X.Y
:
virtualenv--python = pythonX.Y / home / myusername / path / to / virtualenv
4) Reinstall your packages¶
pip install - r / tmp / requirements.txt # or path to your existing requirements.txt
pip is able to uninstall most installed packages. Known exceptions are:,Pure distutils packages installed with python setup.py install, which leave behind no metadata to determine what files were installed.,Uninstall all the packages listed in the given requirements file. This option can be used multiple times.,Uninstall a package. Unix/macOS $ python -m pip uninstall simplejson Uninstalling simplejson: /home/me/env/lib/python3.9/site-packages/simplejson /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info Proceed (Y/n)? y Successfully uninstalled simplejson Windows C:\> py -m pip uninstall simplejson Uninstalling simplejson: /home/me/env/lib/python3.9/site-packages/simplejson /home/me/env/lib/python3.9/site-packages/simplejson-2.2.1-py3.9.egg-info Proceed (Y/n)? y Successfully uninstalled simplejson
python -m pip uninstall [options] <package> ...
python -m pip uninstall [options] -r <requirements file> ...
py -m pip uninstall [options] <package> ...
py -m pip uninstall [options] -r <requirements file> ...
$ python - m pip uninstall simplejson
Uninstalling simplejson:
/home/me / env / lib / python3 .9 / site - packages / simplejson /
home / me / env / lib / python3 .9 / site - packages / simplejson - 2.2 .1 - py3 .9.egg - info
Proceed(Y / n) ? y
Successfully uninstalled simplejson
C: \ > py - m pip uninstall simplejson
Uninstalling simplejson:
/home/me / env / lib / python3 .9 / site - packages / simplejson /
home / me / env / lib / python3 .9 / site - packages / simplejson - 2.2 .1 - py3 .9.egg - info
Proceed(Y / n) ? y
Successfully uninstalled simplejson
My question is that how could I remove anycodings_virtualenv virtualenv and tensorflow thoroughly and anycodings_virtualenv reinstall them.,so I guess the url I modified cause it, and anycodings_virtualenv I try to reinstall virtualenv and anycodings_virtualenv tensorflow, to make my install clean.,for now I could not uninstall virtualenv anycodings_virtualenv neither install it, but it still anycodings_virtualenv exist....that's really wired.,for I have python already, so I install anycodings_virtualenv virtualenv by: sudo pip install --upgrade anycodings_virtualenv virtualenv
have been two years but anyways yo need anycodings_installation to uninstall with > //Reinstal python anycodings_installation 2 or 3 with new SO update
brew update
sudo installer - pkg / Library / Developer / CommandLineTools / Packages / macOS_SDK_headers_for_macOS_10 .14.pkg - target /
brew reinstall python @3
Now, you just need to run:
(tensorflow) $ pip install--upgrade tensorflow # for Python 2.7 (tensorflow) $ pip3 install--upgrade tensorflow # for Python 3. n
And remove by: (this is for virtualenv, anycodings_installation you change the path, following path also anycodings_installation should be changed to anycodings_installation ~/development/project/tensorflow)
$ rm - r~/tensorflow
If you install tensorflow with native anycodings_installation pip:
$ pip uninstall tensorflow $ pip3 uninstall tensorflow