简体   繁体   English

无法安装python模块

[英]Can't install python modules

I have a problem with the following command: 我对以下命令有疑问:

setup.py install. setup.py安装。

I know it should work, I have tried it on a laptop but I don't have access to it at the moment. 我知道它应该可以工作,我已经在笔记本电脑上尝试过了,但是目前无法访问它。 I need to complete a homework so I tried the same on my PC. 我需要完成一项作业,因此我在PC上尝试了相同的作业。 And when I type the same command into cmd it just runs pyscripter as if I would use right click on setup.py and click edit with pyscripter. 当我在cmd中键入相同的命令时,它将运行pyscripter,就像我将在setup.py上单击鼠标右键,然后单击pyscripter编辑一样。 It does nothing else. 它什么也没做。 I am sure that I am in the right folder in cmd. 我确定我在cmd中的正确文件夹中。

My python version is 2.7 and my pyscripter version is v2.5.3. 我的python版本是2.7,而pyscripter版本是v2.5.3。 My OS is win7. 我的操作系统是win7。 I have tried to install other modules but I get the same response. 我尝试安装其他模块,但得到相同的响应。

Has anyone encountered the same problem? 有没有人遇到过同样的问题? I have searched the internet but I haven't found any answers to this problem. 我已经搜索了互联网,但没有找到任何解决此问题的方法。

Assuming that you installed Python 2.7 in the default folder ie c:\\python27 , then you can type: 假设您在默认文件夹(即c:\\python27安装了Python 2.7,则可以输入:

c:\python27\python setup.py install

Wherever you installed it, you should append that path to your PATH variable (you'll need to log on as an admin to do that). 无论在哪里安装,都应将该路径附加到PATH变量中(您需要以管理员身份登录才能执行此操作)。

Do python setup.py install instead. 改为python setup.py install

Windows is probably not set up to recognize .py files as executable. Windows可能未设置为将.py文件识别为可执行文件。

Here is an awesome site for windows binaries: http://www.lfd.uci.edu/~gohlke/pythonlibs/ 这是Windows二进制文件的绝佳站点: http : //www.lfd.uci.edu/~gohlke/pythonlibs/

If the library you need is there, just download and install like any other windows program... 如果您需要的库在那里,只需像其他任何Windows程序一样下载并安装...

Recently our class at school used all of the above programs. 最近,我们在学校的课堂上使用了所有上述程序。 about a handful of students had trouble installing like you described. 大约有少数学生无法像您描述的那样安装。 Fortunally I didnt not have this problen but I can suggest you use Administration priviledges. 幸运的是我没有这个问题,但是我可以建议您使用管理权限。

Make sure you download the correct version. 确保下载正确的版本。

Go to your download folder and look at the file you have downloaded (do this via my computer not from your web browser) 转到下载文件夹,查看已下载的文件(通过计算机而不是通过Web浏览器执行此操作)

Right click on the file and then click run as an administrator 右键单击该文件,然后单击以管理员身份运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM