新手入门python3,安装第三方库出错后若干解决方法整理

pip/jupyter notebook/pycharm


初学python3,陆续安装了anaconda和pycharm,安装第三方库时遇到一些问题,浏览多方资源陆续尝试,分享解决方法如下。
1、pip
以requests库为例
错误代码:
pip install requests
File “”, line 1
pip install requests
^
SyntaxError: invalid syntax

解决方法:
cmd 运行where python
pip install requests

2、jupyter notebook
以moviepy库为例,通过pip install moviepy方法安装后,jupyter notebook运行提示,ModuleNotFoundError: No module named ‘moviepy’。

(1)管理员身份运行 anaconda prompt , conda install moviepy
报错:Solving environment: failed

CondaHTTPError: HTTP 404 NOT FOUND for url https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/`/noarch/repodata.json
Elapsed: 00:00.006553
(2)删除清华镜像,
(base) C:\WINDOWS\system32>conda config --remove-key channels

(base) C:\WINDOWS\system32>conda config --show channels
channels:
defaults
(3)继续conda install moviepy,报错:
PackagesNotFoundError: The following packages are not available from current channels:

moviepy
(4)搜索mooviepy, anaconda search -t moviepy
选择合适资源,我选的是 pranathi/moviepy
anaconda show pranathi/moviepy查看详细信息
提示:To install this package with conda run:
conda install --channel https://conda.anaconda.org/pranathi moviepy
(5)运行 conda install --channel https://conda.anaconda.org/pranathi moviepy
提示出错
Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
moviepy
win_inet_pton
Use "conda info " to see the dependencies for each package
(6)更改安装命令为
conda install -c conda-forge --channel https://conda.anaconda.org/pranathi moviepy
确认安装后成功。
3、pycharm待更新

你可能感兴趣的:(python,运行问题统计)