最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】mac中卸载virtualenv出错:Not uninstalling virtualenv at outside environment

Mac crifan 4853浏览 0评论

折腾:

【貌似无需解决】Mac中active后virtualenv没有生效

期间,

卸载virtualenv出错:

<code>➜  tensorflow pip uninstall virtualenv
Not uninstalling virtualenv at /usr/local/lib/python2.7/site-packages, outside environment /Users/crifan/dev/dev_root/tensorflow/venv/bin/..
</code>

virtualenv Not uninstalling virtualenv at

Not uninstalling virtualenv at

python – How do I remove/delete a virtualenv? – Stack Overflow

然后先去尝试,取消激活试试?

<code>➜  tensorflow deactive
zsh: command not found: deactive
➜  tensorflow deactivate
</code>

然后好像是可以取消激活了?

不过突然发现:

貌似在active后的tensorflow的图标(从默认的绿色变成)红色,就是已经算是激活了?

如果是的话:

则之前的virtualenv的activate则一直是正常的

-》只不过显示出来的效果不是正常的:

(xxx) $

而是 zsh中右箭头从绿色变成红色

去确认看看

并不是。

然后通过pip list也可以看出:

<code>➜  tensorflow pip list --format=columns
Package                       Version
----------------------------- ---------
asn1crypto                    0.24.0
astroid                       1.5.3
attrs                         17.3.0
Automat                       0.6.0
backports.functools-lru-cache 1.4
browsermob-proxy              0.8.0
certifi                       2017.11.5
cffi                          1.11.2
chardet                       3.0.4
configparser                  3.5.0
constantly                    15.1.0
cryptography                  2.1.4
cssselect                     1.0.1
enum34                        1.1.6
hyperlink                     17.3.1
idna                          2.6
incremental                   17.5.0
ipaddress                     1.0.19
isort                         4.2.15
lazy-object-proxy             1.3.1
lxml                          4.1.1
mccabe                        0.6.1
parsel                        1.2.0
pip                           9.0.1
pyasn1                        0.4.2
pyasn1-modules                0.2.1
pycparser                     2.18
PyDispatcher                  2.0.5
pylint                        1.7.2
pyOpenSSL                     17.5.0
queuelib                      1.4.2
requests                      2.18.4
Scrapy                        1.4.0
selenium                      3.7.0
service-identity              17.0.0
setuptools                    38.4.0
singledispatch                3.4.0.3
six                           1.10.0
speedtest-cli                 1.0.7
Twisted                       17.9.0
urllib3                       1.22
virtualenv                    15.1.0
w3lib                         1.18.0
wheel                         0.30.0
wrapt                         1.10.11
zope.interface                4.4.3
➜  tensorflow
</code>

没有进入虚拟环境

否则pip list应该显示为空?

不去管,总之,后来再去删除之前虚拟环境的文件夹后:

<code>➜  tensorflow ll
total 8
drwxr-xr-x  16 crifan  staff   512B  1 27 13:07 bin
drwxr-xr-x   3 crifan  staff    96B  1 27 13:06 include
drwxr-xr-x   3 crifan  staff    96B  1 27 13:06 lib
-rw-r--r--   1 crifan  staff    60B  1 27 13:09 pip-selfcheck.json
➜  tensorflow cd ..
➜  virtualenv ll
total 0
drwxr-xr-x  7 crifan  staff   224B  1 27 13:09 tensorflow
➜  virtualenv rm -rf tensorflow
</code>

重新去卸载virtualenv就可以了:

<code>➜  virtualenv pip uninstall virtualenv
Uninstalling virtualenv-15.1.0:
  /usr/local/bin/virtualenv
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/INSTALLER
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/METADATA
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/RECORD
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/WHEEL
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/entry_points.txt
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/metadata.json
  /usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/top_level.txt
  /usr/local/lib/python2.7/site-packages/virtualenv.py
  /usr/local/lib/python2.7/site-packages/virtualenv.pyc
  /usr/local/lib/python2.7/site-packages/virtualenv_support/__init__.py
  /usr/local/lib/python2.7/site-packages/virtualenv_support/__init__.pyc
  /usr/local/lib/python2.7/site-packages/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl
  /usr/local/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl
  /usr/local/lib/python2.7/site-packages/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl
  /usr/local/lib/python2.7/site-packages/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl
Proceed (y/n)? y
  Successfully uninstalled virtualenv-15.1.0
</code>

【总结】

确保退出你的虚拟环境,然后删除掉虚拟环境的文件夹,再去:

<code>pip uninstall virtualenv
</code>

即可正常卸载。

转载请注明:在路上 » 【已解决】mac中卸载virtualenv出错:Not uninstalling virtualenv at outside environment

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.176 seconds, using 22.04MB memory