root@ecs-dac4:~/resnet50_firstapp/script# python transferPic.py
Traceback (most recent call last):
File "transferPic.py", line 1, in <module>
import numpy as np
ImportError: No module named numpy
缺少numpy包
root@ecs-dac4:~# pip install numpy
Collecting numpy
Downloading https://files.pythonhosted.org/packages/dd/2b/205ddff2314d4eea852e31d53b8e55eb3f32b292efc3dd86bd827ab9019d/numpy-1.26.2.tar.gz (15.7MB)
25% |████████ | 3.9MB 22kB/s eta 0:08:48^C
Operation cancelled by user
作为一个云服务器装个numpy都这么慢,换源吧
root@ecs-dac4:~# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ numpy
Collecting numpy
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/dd/2b/205ddff2314d4eea852e31d53b8e55eb3f32b292efc3dd86bd827ab9019d/numpy-1.26.2.tar.gz (15.7MB)
100% |████████████████████████████████| 15.7MB 35kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-aa4CHx/numpy/setup.py", line 53
raise RuntimeError(f'Cannot parse version {FULLVERSION}')
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-aa4CHx/numpy
You are using pip version 7.1.2, however version 23.3.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
换源之后很快,但是包有错误是什么鬼, 先按提示升级一下pip吧
root@ecs-dac4:~# pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/b7/06/6b1ad0ae8f97d7a0d6f6ad640db10780578999e647a9593512ceb6f06469/pip-23.3.2.tar.gz (2.1MB)
100% |████████████████████████████████| 2.1MB 12kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-AmVquj/pip/setup.py", line 7
def read(rel_path: str) -> str:
^
SyntaxError: invalid syntax
pip 也升级不了, 好难!!!