tensorflow - mac 下卸载 virtualenv

标签 tensorflow installation virtualenv

I try to install tensorflow via virtualenv in mac, the reference is here:

  • 因为我已经有了 python,所以我通过以下方式安装 virtualenv: sudo pip install --upgrade virtualenv

  • ~/development project/tensorflow 中构建新的 virtualenv 环境,不在 ~/tensorflow 中正如引用文献中所述:

    virtualenv --system-site-packages ~/development project/tensorflow

    cd ~/development project/tensorflow

  • 活跃虚拟环境:

    source bin/activate # if use bash,and I choose this line to run

  • 当我在 virtualenv 中并运行此命令时:

    (tensorflow)$ pip install --upgrade <$url_to_binary.whl>

    出现错误:

    zsh: parse error near '\n'

  • then I check here to help solve it 它说<$url_to_binary.whl>应替换为 https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl ,我就这么做了。问题就解决了。

  • 但是,当我尝试通过 cd 测试 tensorflow 时, tensorflow 中的某个目录如下:

    (tensorflow)$ cd tensorflow/models/image/mnist

    该目录不存在。

    所以我猜是我修改的网址造成的,我尝试重新安装 virtualenv 和 tensorflow,以使我的安装干净。

  • tensorflow 已成功卸载,但是当我删除 virtualenv 时,它会突然出现:

Exception: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/local/lib/python2.7/site-packages/pip/commands/uninstall.py", line 76, in run requirement_set.uninstall(auto_confirm=options.yes) File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 346, in uninstall req.uninstall(auto_confirm=auto_confirm) File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall paths_to_remove.remove(auto_confirm) File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/usr/local/lib/python2.7/site-packages/pip/utils/init.py", line 267, in renames shutil.move(old, new) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move os.unlink(src) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst'

  • 我删除目录 tensorflow
  • 目前我无法卸载 virtualenv,也无法安装它,但它仍然存在......这确实是连线的。

  • 如果我运行 sudo pip install --upgrade virtualenv它再次说道:

The directory '/Users/Calvino/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/Calvino/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/site-packages

我的问题是如何彻底删除 virtualenv 和 tensorflow 并重新安装它们。

如果有人能提供帮助,我将不胜感激。

最佳答案

已经两年了,但无论如何你需要卸载> //使用新的 SO 更新重新安装 python 2 或 3

brew update
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
brew reinstall python@3

Reference

然后重新安装tensorflow> https://www.tensorflow.org/install/pip

关于tensorflow - mac 下卸载 virtualenv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43708413/

相关文章:

python - 在 docker 容器中运行 tensorflow 时出错

.net - 通过 WiX 3 检测程序集是否位于 GAC 中?

python - 如何将 pytest 与 virtualenv 一起使用?

tensorflow - 尝试将 'n' 转换为张量但失败。错误: None values not supported

python - 了解 tf.extract_image_patches 以从图像中提取补丁

tensorflow - 如何重命名符合名称范围的变量?

.net - 哪个安装程序会安装 Microsoft.Web.Publishing.Tasks.dll?

ubuntu - 无法运行示例应用程序,缺少 libudev.so.0?

python - 如何告诉 VScode,在我运行 high Sierra 的 Mac 上使用哪个版本的 python

python - 在系统范围内安装 pip 和 virtualenv 的官方 "preferred"方式是什么?