gpt4 book ai didi

python - 使用 Virtualenv 将 Tensorflow 安装到 Python3

转载 作者:太空宇宙 更新时间:2023-11-03 15:31:40 26 4
gpt4 key购买 nike

我正在尝试按照此网页上的说明使用 virtualenv 将tensorflow安装到python3。我使用的是 Mac Sierra,并且 python2.7 和 python3.5 都在我的机器上。 https://www.tensorflow.org/install/install_mac#installing_with_virtualenv

使用此方法对于 python2.7 工作正常,但对于 python3.5 失败。以下是我发出pip3 install --upgrade tensorflow的错误消息。

Installing collected packages: tensorflow, setuptools
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/tensorflow-1.0.1.dist-info'
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

如有任何帮助,我们将不胜感激。

最佳答案

用于 virtualenv 的解释器必须在创建时指定。在这种情况下,请使用 virtualenv -p python3 ./tensorflow 指定 python3 作为此特定 virtualenv 的解释器。

关于python - 使用 Virtualenv 将 Tensorflow 安装到 Python3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42855057/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com