全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 python论坛
1309 3
2020-08-17
安装第三方库方法有五种:
一、PyCharm项目安装    PyCharm打开的项目中,选择“File-->settings-->弹出第一层窗口-->选择当前项目下的project interpretor-->点窗口右侧的“+”-->弹出第二层窗口-->在输入框中输入你要安装的库名,比如:pandas-->右边会显示出访问网络,加载基本的信息,说明网络是通的-->点击左下方install pakage按扭即可”。注意,如果没有显示出访问网络信息,即网络不通,可以换个时间、换个网络再试,如果仍不行,这个方法就不可用。



二、PyCharm终端安装
    选中PyCharm下面的“terminal",在终端中录入:pip install pandas 即可,在这里也可以指定版本号,方法是:pip install pandas==1.0.1
    也可以加上镜像站点信息,比如:pip install -i https://mirrors.aliyun.com/pypi/simple pandas
    常见的镜像站点有:
            加州大学:https://mirrors.aliyun.com/pypi/simple

中国科技大学:  https://pypi.mirrors.ustc.edu.cn/simple

豆瓣: http://pypi.douban.com/simple



三、whl文件安装
    whl文件是第三方库的原始文件,这些文件可以去镜像站点上下载并安装,注意下载的版本要和自己的python版本一致,即whl文件名中的库名后面的*.*就是python的版本号。
    方法:
    1、复制whl文件
    2、打开pycharm项目
    3、右键paste
    4、出现提示,直接点OK
    5、在Terminal窗口中,输入:pip install 复制过来的完整的文件名.whl
如:
pip install selenium-3.7.0-py2.py3-none-any.whl
Processing c:\users\zwy\pycharmprojects\firstpro\selenium-3.7.0-py2.py3-none-any.whl
Installing collected packages: selenium
Successfully installed selenium-3.7.0



四、复制全局环境
   全局环境:是指在电脑系统已经安装好了一些第三方库,只是在Pycharm项目中还没有安装这些库,我们将系统中安装好的这些库应用于pycharm的项目中。
   选择“File-->settings-->弹出第一层窗口-->选择当前项目下的project interpretor-->点窗口右侧的“齿轮”-->选择Add-->在新的环境中选择“Inherit global site-pakage” ,点OK

五、复制其他项目库

   将已经安装好的项目第三方库复制过来,这是最有效的方法。
   找到别个给我们的项目中的Lib文件夹下的文件全部复制,粘贴至我们的项目的venv\Lib目录下即可。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2020-8-17 13:19:11
python  最新版本对比


Package                       Version      Latest      Type
----------------------------- ------------ ----------- -----
akshare                       0.6.2        0.6.3       wheel
appdirs                       1.4.3        1.4.4       wheel
asn1crypto                    1.0.1        1.4.0       wheel
astroid                       2.3.1        2.4.2       wheel
astropy                       3.2.1        4.0.1.post1 wheel
atomicwrites                  1.3.0        1.4.0       wheel
attrs                         19.2.0       19.3.0      wheel
Babel                         2.7.0        2.8.0       wheel
backcall                      0.1.0        0.2.0       wheel
backports.functools-lru-cache 1.5          1.6.1       wheel
bitarray                      1.0.1        1.5.2       sdist
bleach                        3.1.0        3.1.5       wheel
bokeh                         1.3.4        2.1.1       sdist
Bottleneck                    1.2.1        1.3.2       sdist
cachetools                    4.0.0        4.1.1       wheel
certifi                       2020.4.5.1   2020.6.20   wheel
cffi                          1.12.3       1.14.2      wheel
Click                         7.0          7.1.2       wheel
cloudpickle                   1.2.2        1.5.0       wheel
colorama                      0.4.1        0.4.3       wheel
connection                    2019.4.13    2020.7.1    sdist
contextlib2                   0.6.0        0.6.0.post1 wheel
cryptography                  2.7          3.0         wheel
Cython                        0.29.13      0.29.21     wheel
cytoolz                       0.10.0       0.10.1      sdist
dash                          1.12.0       1.14.0      sdist
dash-core-components          1.10.0       1.10.2      sdist
dash-renderer                 1.4.1        1.6.0       sdist
dash-table                    4.7.0        4.9.0       sdist
dask                          2.5.2        2.23.0      wheel
distributed                   2.5.2        2.23.0      wheel
docutils                      0.15.2       0.16        wheel
Flask                         1.1.1        1.1.2       wheel
Flask-SQLAlchemy              2.4.1        2.4.4       wheel
fonttools                     4.6.0        4.13.0      wheel
fsspec                        0.5.2        0.8.0       wheel
future                        0.17.1       0.18.2      sdist
gast                          0.2.2        0.4.0       wheel
gevent                        1.4.0        20.6.2      wheel
google-auth                   1.11.2       1.20.1      wheel
google-pasta                  0.1.8        0.2.0       wheel
graphviz                      0.13.2       0.14.1      wheel
greenlet                      0.4.15       0.4.16      wheel
grpcio                        1.27.2       1.31.0      wheel
h5py                          2.9.0        2.10.0      wheel
html5lib                      1.0.1        1.1         wheel
idna                          2.8          2.10        wheel
imageio                       2.6.0        2.9.0       wheel
imagesize                     1.1.0        1.2.0       wheel
importlib-metadata            0.23         1.7.0       wheel
ipykernel                     5.1.2        5.3.4       wheel
ipython                       7.8.0        7.17.0      wheel
isort                         4.3.21       5.4.2       wheel
jedi                          0.15.1       0.17.2      wheel
jieba                         0.41         0.42.1      sdist
Jinja2                        2.10.3       2.11.2      wheel
joblib                        0.13.2       0.16.0      wheel
json5                         0.8.5        0.9.5       wheel
jsonschema                    3.0.2        3.2.0       wheel
jupyter-client                5.3.3        6.1.6       wheel
jupyter-console               6.0.0        6.1.0       wheel
jupyter-core                  4.5.0        4.6.3       wheel
jupyterlab                    1.1.4        2.2.4       wheel
jupyterlab-server             1.0.6        1.2.0       wheel
Keras                         2.3.1        2.4.3       wheel
Keras-Preprocessing           1.1.0        1.1.2       wheel
keyring                       18.0.0       21.3.0      wheel
kiwisolver                    1.1.0        1.2.0       wheel
lazy-object-proxy             1.4.2        1.5.1       wheel
libarchive-c                  2.8          2.9         wheel
llvmlite                      0.29.0       0.34.0      wheel
lxml                          4.4.1        4.5.2       wheel
Markdown                      3.2.1        3.2.2       wheel
matplotlib                    3.1.1        3.3.1       wheel
mock                          3.0.5        4.0.2       wheel
more-itertools                7.2.0        8.4.0       wheel
mpl-finance                   0.10.0       0.10.1      wheel
msgpack                       0.6.1        1.0.0       wheel
multidict                     4.7.4        4.7.6       wheel
mysqlclient                   1.3.14       2.0.1       wheel
nbconvert                     5.6.0        5.6.1       wheel
nbformat                      4.4.0        5.0.7       wheel
neo4j                         4.0.0        4.1.0       sdist
networkx                      2.3          2.4         wheel
nltk                          3.4.5        3.5         sdist
notebook                      6.0.1        6.1.3       wheel
numba                         0.45.1       0.51.0      wheel
numexpr                       2.7.0        2.7.1       wheel
numpy                         1.16.5       1.19.1      wheel
numpydoc                      0.9.1        1.1.0       wheel
opencv-python                 4.3.0.36     4.4.0.42    wheel
openpyxl                      3.0.3        3.0.4       wheel
opt-einsum                    3.2.0        3.3.0       wheel
packaging                     19.2         20.4        wheel
pandas                        0.25.1       1.1.0       wheel
pandas-datareader             0.8.1        0.9.0       wheel
parse                         1.15.0       1.16.0      sdist
parso                         0.5.1        0.8.0       wheel
partd                         1.0.0        1.1.0       wheel
path.py                       12.0.1       12.5.0      wheel
Pillow                        6.2.0        7.2.0       wheel
pip                           19.2.3       20.2.2      wheel
plotly                        4.5.4        4.9.0       wheel
pluggy                        0.13.0       0.13.1      wheel
prometheus-client             0.7.1        0.8.0       wheel
prompt-toolkit                2.0.10       3.0.6       wheel
protobuf                      3.11.3       3.13.0      wheel
psutil                        5.6.3        5.7.2       wheel
public                        2019.4.13    2020.7.1    sdist
py                            1.8.0        1.9.0       wheel
py4j                          0.10.7       0.10.9      wheel
pycodestyle                   2.5.0        2.6.0       wheel
pycparser                     2.19         2.20        wheel
pycryptodomex                 3.9.7        3.9.8       wheel
pycurl                        7.43.0.3     7.43.0.5    wheel
pyecharts                     1.6.0        1.8.1       wheel
pyee                          7.0.1        7.0.2       wheel
pyflakes                      2.1.1        2.2.0       wheel
Pygments                      2.3.1        2.6.1       wheel
pylint                        2.4.2        2.5.3       wheel
pymongo                       3.10.1       3.11.0      wheel
PyMySQL                       0.9.3        0.10.0      wheel
pyodbc                        4.0.27       4.0.30      wheel
pyOpenSSL                     19.0.0       19.1.0      wheel
pyparsing                     2.4.2        2.4.7       wheel
pypinyin                      0.37.0       0.39.0      wheel
pyppeteer                     0.0.25       0.2.2       wheel
pyproj                        1.9.6        2.6.1.post1 wheel
PyQt5                         5.14.1       5.15.0      wheel
PyQt5-sip                     12.7.1       12.8.0      wheel
pyrsistent                    0.15.4       0.16.0      sdist
pyspark                       2.4.5        3.0.0       sdist
pytest                        5.2.1        6.0.1       wheel
pytest-astropy                0.5.0        0.8.0       wheel
pytest-doctestplus            0.4.0        0.8.0       sdist
pytest-openfiles              0.4.0        0.5.0       wheel
python-dateutil               2.8.0        2.8.1       wheel
pytz                          2019.3       2020.1      wheel
PyWavelets                    1.0.3        1.1.1       wheel
pywin32                       223          228         wheel
pywinpty                      0.5.5        0.5.7       wheel
PyYAML                        5.1.2        5.3.1       wheel
pyzmq                         18.1.0       19.0.2      wheel
QtAwesome                     0.6.0        0.7.2       wheel
qtconsole                     4.5.5        4.7.5       wheel
requests                      2.22.0       2.24.0      wheel
rope                          0.14.0       0.17.0      sdist
rsa                           4.0          4.6         wheel
ruamel-yaml                   0.15.46      0.16.10     wheel
scikit-image                  0.15.0       0.17.2      wheel
scikit-learn                  0.22.2.post1 0.23.2      wheel
scipy                         1.4.1        1.5.2       wheel
seaborn                       0.9.0        0.10.1      wheel
simplejson                    3.17.0       3.17.2      wheel
six                           1.12.0       1.15.0      wheel
sortedcollections             1.1.2        1.2.1       wheel
sortedcontainers              2.1.0        2.2.2       wheel
soupsieve                     1.9.3        2.0.1       wheel
Sphinx                        2.2.0        3.2.1       wheel
sphinxcontrib-applehelp       1.0.1        1.0.2       wheel
sphinxcontrib-devhelp         1.0.1        1.0.2       wheel
sphinxcontrib-htmlhelp        1.0.2        1.0.3       wheel
sphinxcontrib-qthelp          1.0.2        1.0.3       wheel
sphinxcontrib-websupport      1.1.2        1.2.4       wheel
spyder                        3.3.6        4.1.4       wheel
spyder-kernels                0.5.2        1.9.3       wheel
SQLAlchemy                    1.3.9        1.3.18      wheel
sympy                         1.4          1.6.2       wheel
tables                        3.5.2        3.6.1       wheel
tblib                         1.4.0        1.7.0       wheel
tensorboard                   1.15.0       2.3.0       wheel
tensorflow                    2.1.0        2.3.0       wheel
tensorflow-estimator          1.15.1       2.3.0       wheel
terminado                     0.8.2        0.8.3       wheel
testpath                      0.4.2        0.4.4       wheel
tornado                       6.0.3        6.0.4       wheel
tqdm                          4.45.0       4.48.2      wheel
tushare                       1.2.54       1.2.60      wheel
tzlocal                       2.0.0        2.1         wheel
urllib3                       1.24.2       1.25.10     wheel
w3lib                         1.21.0       1.22.0      wheel
wcwidth                       0.1.7        0.2.5       wheel
Werkzeug                      0.16.0       1.0.1       wheel
wheel                         0.33.6       0.35.1      wheel
XlsxWriter                    1.2.1        1.3.3       wheel
xlwings                       0.15.10      0.20.3      sdist
zict                          1.0.0        2.0.0       wheel
zipp                          0.6.0        3.1.0       wheel
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-9-6 21:31:17
今天第一次遇到下载的文件中没有whl文件,而包含setup,网上有人说使用这样的方法: python setup.py install 安装文件,先记下。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2020-9-29 17:56:21
补充:
有的库没有找到对应的.whl格式文件,只有.tar.gz格式文件,接下来总结下该类型文件的安装。

以robotframework-ride-1.7.4.tar.gz为例

(1)下载robotframework-ride-1.7.4.tar.gz文件,将此文件放到Python下的Lib文件中;

(2)进入已解压的robotframework-ride-1.7.4文件夹下,可以看到setup.py文件,直接在地址栏输入%comspec%,进入该目录的命令提示符;
(3)命令提示符下键入python.exe setup.py install,回车键后进行自动安装 。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群