Tag: python

“无效的Python安装:无法打开/usr/lib/python2.7/config/Makefile(没有这样的文件或目录)”

我已经用我的python安装做了一些事情,不记得到底是什么。 但是当我尝试打开python命令行时出现错误: richard@richard-desktop:~/projects/hello$ python Traceback (most recent call last): File “/usr/lib/python2.7/site.py”, line 562, in main() File “/usr/lib/python2.7/site.py”, line 544, in main known_paths = addusersitepackages(known_paths) File “/usr/lib/python2.7/site.py”, line 271, in addusersitepackages user_site = getusersitepackages() File “/usr/lib/python2.7/site.py”, line 246, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File “/usr/lib/python2.7/site.py”, line 236, in getuserbase USER_BASE […]

Python源代码在哪里?

我已经安装了Python 2.7用于学习目的(我是一名初学程序员,正在阅读’ 学习Python困难之路 ‘)并且想知道一些事情是如何完成的。 我从Synaptic安装它并想知道源代码所在的文件夹 。 有人能帮我一下吗?

如何从Python获取(XDG)默认用户目录?

例如,在英语中,默认用户文件夹将是: $HOME/Desktop …. $HOME/Videos 在西class牙语中,默认用户文件夹将是: $HOME/Escritorio …. $HOME/Vídeos 文件 ~/.config/user-dirs.dirs具有默认文件夹的本地化名称。 (总是?)。 我需要从python脚本中获取这些名称。 我不想解析那个文件。 还有其他优雅的方式吗? 我发现了这个 : from xdg.BaseDirectory import * print xdg_cache_home print xdg_config_dirs print xdg_config_home print xdg_data_dirs print xdg_data_home 但它不会返回那些文件夹。 提前致谢!

无法找到包裹lightread

我已将源代码更改为本地服务器。 我正在使用Ubuntu 12.10。 当我在终端中输入apt-cache搜索时,它什么也没显示。 当我安装lightread时,它显示无法找到包lightread。 当我通过python手动安装lightread时。 表明 python ‘/home/peng/Downloads/quickly_trunk/setup.py’ Traceback (most recent call last): File “/home/peng/Downloads/quickly_trunk/setup.py”, line 93, in data_files=[(‘share/icons/hicolor/128×128/apps’, [‘data/media/lightread.png’])] File “/usr/lib/python2.7/dist-packages/DistUtilsExtra/auto.py”, line 71, in setup src_mark(src, ‘setup.py’) File “/usr/lib/python2.7/dist-packages/DistUtilsExtra/auto.py”, line 527, in src_mark src.remove(path) KeyError: ‘setup.py’ 如何解决问题?

美丽的汤4不使用Python 3.4.0

我使用的是Ubuntu 14.04 64位操作系统。 我使用这个命令安装了Beautiful Soup 4 : sudo apt-get install python-bs4 使用Python 2.7.6 ,我可以bs4导入bs4模块。 但是当我使用Python 3.4.0时它向我展示了这个错误。 >>>import bs4 Traceback (most recent call last): File “”, line 1, in ImportError: No module named ‘bs4’ 我也尝试使用pip安装它。 sudo pip install beautifulsoup4 但是它再次与Python 3.4.0无关。 现在我已经卸载了pip并且还卸载了Beautiful Soup 4 sudo apt-get remove python-bs4 sudo apt-get remove python-pip 接下来我应该怎么做才能为Python 2.7.6和Python 3.4.0正确安装Beautiful Soup […]

无法安装python-dev

Ubuntu 14.04.3。 我无法安装python-dev: yura@ubuntu:~$ sudo apt-get install python-dev Reading package lists… Done Building dependency tree Reading state information… Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved […]

什么“命令”python setup.py egg_info“失败,错误代码为1”是什么意思?

当我尝试安装一些像BeautifulSoup这样的基本python库时,我不断收到错误。 错误如下所示: 究竟是什么意思,我该如何解决? 我已经尝试过这些命令: pip install –upgrade pip install pip install unroll 正如其他post所建议的那样,但这似乎也没有帮助..

我无法在我的ubuntu中安装easy_install

我必须在ubuntu中安装Review board,我尝试了以下命令,但我收到错误 sudo apt-get install python-setuptools. Reading package lists… Done Building dependency tree Reading state information… Done Package python-setuptools is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package python-setuptools has no installation candidate 然后我尝试下面的命令,但为此我也收到错误消息: […]

pipinstall给出“命令”python setup.py egg_info“失败,错误代码为1”

我试图在Ubuntu 16.04上使用pip install安装python包rpy2 : pip install rpy2==2.2.7 但得到错误信息(见下面的完整输出): Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-EuOI6K/unroll/ 其他软件包pip2发生同样的事情,例如pip install unroll或使用pip2 。 我认为这篇文章是同一个问题,但它通过使用sudo解决了。 解决了尝试 我在这篇文章中尝试过解决方案,例如: pip install –upgrade setuptools , (sudo) easy_install -U setuptools ,或sudo apt-get install python-setuptools ,但无济于事。 python / pip信息 有人建议我可能有一个奇怪的python / pip安装,这里有一些信息: sudo which python pip pip2 | xargs -rd ‘\n’ […]

如何自动激活Python环境

我使用virtualenv为我在/opt上安装的Python 3.4.1创建了一个环境。 环境在~/py34 。 每次我想使用它,我都要输入: source py34/bin/activate python 反正有没有创建快捷方式,所以每次我想使用它时都不必输入这些命令?