蟒蛇不导入 [英] Python Not Importing
问题描述
所以,我下载了由人民作出蟒LastFM等API。这里找到: HTTP://$c$c.google.com/p/python -lastfm /
So i downloaded the lastfm api for python made by people. found here: http://code.google.com/p/python-lastfm/
我要通过Dreamhost的托管网站。我不是能够建立使用该模块:
结果
结果
蟒蛇setup.py构建
在我的壳,我用腻子进入。但是,当我将运行结果
结果
蟒蛇的setup.py安装
它会返回一个错误。搞清楚所有的安装确实是从lib目录到Python站点包文件夹投档,我决定尝试和做手工。我是成功的在我的本地机器上这样做,并能没有错误运行Python和类型进口LastFM等。但我无法得到它的工作在我的虚拟主机提供商。
I have a website hosting through dreamhost. I wasnt able to build the module using:
python setup.py build
in my shell that i used putty to get into. But when i would run
python setup.py install
it would return an error. Figuring that all install really does is throw the files from the lib dir into the python site-packages folder, i decided to try and manually do it. I was successful in doing so on my local machine and was able to run python and type import lastfm with no errors. But i could not get it working on my webhost.
我有相当的空间商目前clusterfuck由于我n00bism,我的意思是我尝试安装Python多次了,我真的不知道它在哪里安装成功。我只知道我可以去腻子型Python和它将运行,但我不知道从什么地方。所以我复制的LastFM等建立了每python2.x / lib目录/站点包我能找到,但无济于事。
I do have quite the clusterfuck currently on my webhost due to my n00bism, by that i mean i tried installing python multiple times, and i dont really know where it installed successfully. All i know is i can go to putty and type python and it will run, but i dont know exactly where from. So i copied the lastfm build over to every python2.x/lib/site-packages i could find, but to no avail.
我不知道我在做什么错。它说,蟒蛇OS路径是usr / lib目录/和的python2.5我的身影USR指根或地方。 IDK的。 IM很困惑。
I dont know what im doing wrong. It says pythons os path is usr/lib/python2.5 and i figure usr means the root or local. idk. im very confused.
我也很好奇,因为我可以通过键入搜索导入的东西,如MySQL和SQLite
结果
进口MySQLdb的结果
进口sqlite的结果
进口sqlite3的结果
而所有这些工作,但我没有看到他们在我的Python路径中的任何地方。
I also am curious because i am able to import things like mysql and sqlite by typing
import MySQLdb
import sqlite
import sqlite3
and all those work, yet i dont see them anywhere in my python path.
在此先感谢。如果我需要查看更多信息,请告诉我。谢谢!
thanks in advance. if i need to list more info please tell me. thanks!
编辑:
$蟒蛇的setup.py安装
运行安装
错误:无法创建或安装目录中删除文件
$ python setup.py install running install error: can't create or remove files in install directory
而试图在添加或删除文件时出现以下错误
安装目录:
The following error occurred while trying to add or remove files in the installation directory:
[Errno 13] Permission denied: '/usr/lib/python2.5/site-packages/test-easy-install-11740.write-test'
您指定的(通过--install-dir安装目录 - preFIX,或
Distutils的默认设置)是:
The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:
/usr/lib/python2.5/site-packages/
也许你的帐户不具有此目录的写入权限?如果
安装目录是一个系统拥有的目录,则需要登录
作为管理员或根账户。如果您没有管理
访问这台机器,你不妨选择不同的安装
目录,preferably一个是在PYTHONPATH环境上市
变量。
Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable.
有关其他选项的信息,你不妨咨询
在文档:
For information on other options, you may wish to consult the documentation at:
http://peak.telecommunity.com/EasyInstall.html
请为您的系统进行相应的更改,然后重试。
Please make the appropriate changes for your system and try again.
这是错误我会得到时候我会尝试做蟒蛇的setup.py安装
that is the error i would get when i would try to do python setup.py install
推荐答案
在大多数情况下,对任何 UNIX
的系统上安装Python包(Linux的/ OS X / BSD)你需要做的:
Most of the time, to install python packages on any UNIX
based system (linux/os x/bsd) you need to do:
sudo的蟒蛇的setup.py安装
这是当然,如果你有sudo的权利。
This is, of course, if you have sudo rights.
这篇关于蟒蛇不导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!