Python 使用pip3安装NumPy失败,但使用pip安装可以

Python 使用pip3安装NumPy失败,但使用pip安装可以,python,numpy,tensorflow,pip,Python,Numpy,Tensorflow,Pip,我需要用pip3安装TensorFlow,当它进入安装NumPy步骤时,它停止并给出错误: (当我尝试用pip安装NumPy时,它还可以,但我需要它来与python 3一起工作。) 提前感谢您的帮助 Traceback (most recent call last): File "<string>"

我需要用pip3安装TensorFlow,当它进入安装NumPy步骤时,它停止并给出错误: (当我尝试用pip安装NumPy时,它还可以,但我需要它来与python 3一起工作。) 提前感谢您的帮助

    Traceback (most recent call last):                                                                          
      File "<string>", line 1, in <module>                                                                      
      File "/tmp/pip-build-v32qiaml/numpy/setup.py", line 68                                                    
        f"NumPy {VERSION} may not yet support Python "                                                          
                                                     ^                                                          
    SyntaxError: invalid syntax                                                                                 

    ----------------------------------------                                                                    
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v32qiaml/numpy/```

回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/tmp/pip-build-v32qiaml/numpy/setup.py”,第68行
f“NumPy{VERSION}可能还不支持Python”
^                                                          
SyntaxError:无效语法
----------------------------------------                                                                    
命令“python setup.py egg_info”在/tmp/pip-build-v32qiaml/numpy中失败,错误代码为1/```
是在3.6版的Python中添加的。您的
pip3
似乎在早期的Python(可能是3.5)下运行

pip--version
pip3--version
检查您的
pip
pip3--version
版本。如果需要,请安装最新的Python版本。

已在3.6版中添加到Python中。您的
pip3
似乎在早期的Python(可能是3.5)下运行


pip--version
pip3--version
检查您的
pip
pip3--version
版本。如果需要,请安装最新的Python版本。

切勿使用任何
pip
pip3
等脚本。相反,始终使用surefire方法调用特定Python解释器的pip模块:
path/to/pythonX.Y-m pip install…
谢谢@sinoroc好建议:)切勿使用任何
pip
pip3
等脚本。相反,始终使用surefire方法调用特定Python解释器的pip模块:
path/to/pythonX.Y-m pip install…
谢谢@sinoroc好建议:)谢谢,看起来python版本是3.5。我现在已经更新了,谢谢,看起来python版本是3.5。我现在已经更新了。