2021年Ubuntu下python2.7

本文详细记录了在Ubuntu系统下安装和配置Python 2.7的过程,包括VMware下的Ubuntu安装、修改apt源、更换输入法、安装PyCharm社区版以及Python 2.7的安装步骤,旨在帮助开发者避免遇到类似问题时花费过多时间。

最近用一个python库,只能在Linux系统下的python2.7使用,我在window下弄了好久,在Ubuntu下的python3也弄了好久,最后还是老老实实的使用Ubuntu下python2.7。但是网上的记录都很乱,感觉花费了很长时间,还重装了好几次系统,现在记录一下步骤

1. 在VMware下安装Ubuntu
https://zhuanlan.zhihu.com/p/38797088
这个是安装全英文版的,比较好

2. 修改apt源,直接在/ect/apt 里改,不用命令行
https://zhuanlan.zhihu.com/p/142014944

用vim还是不熟悉,我是直接在目录里打开list文件,像记事本一样打开、修改。
目录位置:/etc/apt/sources.list

3. 换输入法,界面还是英文,只是添加拼音输入法
https://blog.youkuaiyun.com/chan70707/article/details/82980499
一定是先换源,再改这个,不然下载太慢了

4. 安装pycharm,方便虚拟环境使用
https://blog.youkuaiyun.com/no1xium/article/details/108890984
直接下community版本的,就是免费,还有一些教程竟然还教破解,没必要

pip install PyAudio DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Defaulting to user installation because normal site-packages is not writeable Collecting PyAudio Downloading PyAudio-0.2.14.tar.gz (47 kB) |████████████████████████████████| 47 kB 28 kB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Building wheels for collected packages: PyAudio Building wheel for PyAudio (PEP 517) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python /home/abot/.local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpXvTLKr cwd: /tmp/pip-install-__KrI2/pyaudio Complete output (18 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/pyaudio copying src/pyaudio/__init__.py -> build/lib.linux-x86_64-2.7/pyaudio running build_ext building 'pyaudio._portaudio' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/src/pyaudio x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-D7NSzq/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -c src/pyaudio/main.c -o build/temp.linux-x86_64-2.7/src/pyaudio/main.o src/pyaudio/main.c:31:10: fatal error: portaudio.h: 没有那个文件或目录 #include "portaudio.h" ^~~~~~~~~~~~~ compilation terminated.
07-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值