linux源码安装apex
不能pip install是真的难受
1.pip install apex --user
pip install apex --user
Successfully installed
MarkupSafe-1.1.1
PasteDeploy-2.1.1
SQLAlchemy-1.3.22
anykeystore-0.2
apex-0.9.10.dev0
cryptacular-1.5.5
defusedxml-0.6.0
hupper-1.10.2
oauthlib-3.1.0
pbkdf2-1.3 plaster-1.0
plaster-pastedeploy-0.7
pyramid-1.10.5
pyramid-mailer-0.15.1
python3-openid-3.2.0
repoze.sendmail-4.4.1
requests-oauthlib-1.3.0
transaction-3.0.1
translationstring-1.4
velruse-1.1.1
venusian-3.0.0
webob-1.8.6
wtforms-2.3.3
wtforms-recaptcha-0.3.2
zope.deprecation-4.4.0
zope.interface-5.2.0
zope.sqlalchemy-1.3
2.源码安装
源码安装的部分记录,下了几十个包
ImportError: cannot import name 'tags' from 'packaging' (/opt/anaconda3-2019.3/lib/python3.7/site-packages/packaging/__init__.py):
File "/home/library/cryptacular-1.5.5/SConstruct", line 13:
full_tag = enscons.get_abi3_tag()
File "/home/lthpc/.local/lib/python3.7/site-packages/enscons/__init__.py", line 99:
from . import tags
File "/home/lthpc/.local/lib/python3.7/site-packages/enscons/tags.py", line 38:
from packaging import tags
是因为没有packaging包,但是没提示,自己安装
pip install packaging-20.8-py2.py3-none-any.whl --user
再次尝试
lthpc@lthpc:/home/library/cryptacular-1.5.5$ sudo python3 setup.py install
一直报这个错
Do not know how to make File target `install' (/home/library/cryptacular-1.5.5/install).
看文件时找到了/home/library/cryptacular-1.5.5/dist/cryptacular-1.5.5-cp37-abi3-manylinux2010_x86_64.whl 这个文件
再次尝试
(base) lthpc@lthpc:~$ cd /home/library/cryptacular-1.5.5/dist
(base) lthpc@lthpc:/home/library/cryptacular-1.5.5/dist$ pip install cryptacular-1.5.5-cp37-abi3-manylinux2010_x86_64.whl --user
Processing ./cryptacular-1.5.5-cp37-abi3-manylinux2010_x86_64.whl
Requirement already satisfied: setuptools in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from cryptacular==1.5.5) (41.0.1)
Requirement already satisfied: pbkdf2 in /opt/anaconda3-2019.3/lib/python3.7/site-packages/pbkdf2-1.3-py3.7.egg (from cryptacular==1.5.5) (1.3)
Installing collected packages: cryptacular
Successfully installed cryptacular-1.5.5
再次尝试
pip install apex --user
Collecting requests-oauthlib (from velruse>=1.0.3->apex)
安装requests_oauthlib
(base) lthpc@lthpc:/home/library$ pip install requests_oauthlib-1.3.0-py2.py3-none-any.whl --user
Processing ./requests_oauthlib-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.0.0 in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from requests-oauthlib==1.3.0) (2.22.0)
Collecting oauthlib>=3.0.0 (from requests-oauthlib==1.3.0)
安装oauthlib>=3.0.0
(base) lthpc@lthpc:/home/library$ pip install oauthlib-3.1.0-py2.py3-none-any.whl --user
Processing ./oauthlib-3.1.0-py2.py3-none-any.whl
Installing collected packages: oauthlib
Successfully installed oauthlib-3.1.0
安了requests_oauthlib还是在收集这个包,再安装一次
(base) lthpc@lthpc:/home/library$ pip install requests_oauthlib-1.3.0-py2.py3-none-any.whl --user
Processing ./requests_oauthlib-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.0.0 in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from requests-oauthlib==1.3.0) (2.22.0)
Requirement already satisfied: oauthlib>=3.0.0 in /home/lthpc/.local/lib/python3.7/site-packages (from requests-oauthlib==1.3.0) (3.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib==1.3.0) (2019.6.16)
Requirement already satisfied: idna<2.9,>=2.5 in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib==1.3.0) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib==1.3.0) (1.24.2)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /opt/anaconda3-2019.3/lib/python3.7/site-packages (from requests>=2.0.0->requests-oauthlib==1.3.0) (3.0.4)
ERROR: velruse 1.1.1 requires anykeystore, which is not installed.
ERROR: velruse 1.1.1 requires python3-openid, which is not installed.
Installing collected packages: requests-oauthlib
Successfully installed requests-oauthlib-1.3.0
再次尝试
pip install apex --user
Collecting anykeystore (from velruse>=1.0.3->apex)
(base) lthpc@lthpc:~$ cd /home/library/velruse-1.1.1
(base) lthpc@lthpc:/home/library/velruse-1.1.1$ sudo python3 setup.py intsall
Searching for python3-openid
在官网找到的第一个python3-openid是老版本的,安装时一直报错
You probably meant to install and run python3-openid
找到新的版本的python3-openid
(base) lthpc@lthpc:/home/library$ pip install python3_openid-3.2.0-py3-none-any.whl --user
ERROR: velruse 1.1.1 requires anykeystore, which is not installed.
Installing collected packages: python3-openid
Successfully installed python3-openid-3.2.0
安装anykeystore
(base) lthpc@lthpc:~$ cd /home/library
(base) lthpc@lthpc:/home/library$ tar -zxvf anykeystore-0.2.tar.gz
(base) lthpc@lthpc:/home/library/anykeystore-0.2$ sudo python3 setup.py install
Finished processing dependencies for anykeystore==0.2
再次尝试
(base) lthpc@lthpc:/home/library/velruse-1.1.1$ sudo python3 setup.py install
Searching for defusedxml
(base) lthpc@lthpc:/home/library$ pip install defusedxml-0.6.0-py2.py3-none-any.whl --user
再次尝试
(base) lthpc@lthpc:/home/library$ pip install apex --user
成功
3.TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instead.
sudo pip uninstall apex
报错说没安装,不管了直接下面的
Apex报错:TypeError: Class advice impossible in Python3. Use the @Implementer class decorator instead.
https://blog.csdn.net/zjc910997316/article/details/103528344
不能直接pip install apex
卸载从新安装
pip uninstall apex
git clone https://www.github.com/nvidia/apex
cd apex
sudo python3 setup.py install
直接在https://www.github.com/nvidia/apex下载zip解压改名也可
4.注意
有时候安装了一个包一直提示你没安装,可能版本不对,或者直接安装下一个依赖包,忽略这个提示,在官网找到的第一个python3-openid是老版本的,安装时一直报错,注意选对版本,可以换的试一下,有时候少包是因为没有packaging包,但是没提示,自己安装。