首页 > 编程语言 > 详细

python3环境下遇到的问题

时间:2019-09-11 20:25:09      阅读:91      评论:0      收藏:0      [点我收藏+]

pip 解决 ImportError: cannot import name ‘main‘

当 pip 更新至最新版的时候,不管是执行 pip list 还说 pip install packageName 安装包,都会抛出一个异常

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name ‘main‘

那么应该怎么解决呢,其实很简单, 编辑 /usr/bin/pip 文件,修改代码

from pip._internal import main

Not able to pip install pickle in python 3.6

pickle module is part of the standard library in Python for a very long time now so there is no need to install it via pip. I wonder if you IDE or command line is not messed up somehow so that it does not find python installation path. Please check if your %PATH% contains a path to python (e.g. C:\Python36\ or something similar) or if your IDE correctly detects root path where Python is installed.

或者安装

You can pip install pickle by running command pip install pickle-mixin. Proceed to import it using import pickle. This can be then used normally.

 

import tqdm 

安装失败,那就多试试这几个镜像

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tqdm

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

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

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

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

note:新版ubuntu要求使用https源,要注意。

 

今天在ubuntu中安Python3的时候,出现了一个错误:zipimport.ZipImportError: can‘t decompress data; zlib not available

网上找了各种办法都无法解决实际问题,记录下解决过程。

错误:

zipimport.ZipImportError: can‘t decompress data; zlib not available
Makefile:1079: recipe for target ‘install‘ failed
make: *** [install] Error 1

解决办法:安装依赖

1 sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev 2 libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev 3 xz-utils tk-dev

重新 make && make install

 

python安装pandas库出现 No module named ‘_lzma’

 

python3环境下遇到的问题

原文:https://www.cnblogs.com/chenglansky/p/11507931.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!