linux python虚拟环境 error_阿里云Linux系统配置python3-虚拟环境-mysql --踩坑实践(Ubuntu系统转centOS7)...

本文记录了在Ubuntu系统中配置Python3虚拟环境遇到的错误及解决方案,包括pip源问题、Python3安装和虚拟环境创建。由于问题未解决,作者转向了CentOS7系统。在CentOS7中,详细介绍了如何安装Python3、配置虚拟环境,以及解决安装过程中遇到的zlib、virtualenv、mysqlclient和阿里云SDK相关问题的方法。
摘要由CSDN通过智能技术生成

序言:个人使用阿里云的服务器,Ubuntu系统时在创建虚拟环境处卡住,多次修改无果后改用CentOS系统配置环境成功,但是其中也是尝试多次,这里就把自己找的能够配置成功的方法整理起来,以备后续有相关配置时,能够快速应对。

一、Ubuntu系统配置(mysql --virtualenv)

1. mysql安装

平时使用虚拟机时,基本没有太多涉及到这样的问题。就是安装前先apt-git命令升级下

sudo apt-get update

sudo apt-get install mysql-server

注:Ubuntu 最新系统自带python3不存在安装python部分,所以直接跳转到虚拟环境的安装。

2. 安装虚拟环境

安装虚拟环境报如下错误:

root@iZ2zef57ni8z6z1jo0l6flZ:/home# virtualenv django_news

Running virtualenv with interpreter /usr/bin/python2

New python executable in /home/django_news/bin/python2

Also creating executable in /home/django_news/bin/python

Please make sure you remove any previous custom paths from your /root/.pydistutils.cfg file.

Installing setuptools, pkg_resources, pip, wheel...

Complete output from command /home/django_news/bin/python2 - setuptools pkg_resources pip wheel:

Collecting setuptools

Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/66/e8/570bb5ca88a8bcd2a1db9c6246bb66615750663ffaaeada95b04ffe74e12/setuptools-40.2.0-py2.py3-none-any.whl (568kB)

Collecting pkg_resources

Exception:

Traceback (most recent call last):

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/basecommand.py", line 209, in main

status = self.run(options, args)

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/commands/install.py", line 328, in run

wb.build(autobuilding=True)

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/wheel.py", line 748, in build

self.requirement_set.prepare_files(self.finder)

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_set.py", line 360, in prepare_files

ignore_dependencies=self.ignore_dependencies))

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_set.py", line 512, in _prepare_file

finder, self.upgrade, require_hashes)

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/req/req_install.py", line 273, in populate_link

self.link = finder.find_requirement(self, upgrade)

File "/usr/share/python-wheels/pip-8.1.1-py2.py3-none-any.whl/pip/index.py", line 442, in find_requirement

all_candidates = self.find_all_candidates(req.name)

File "/usr/share/pyt

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值