简体   繁体   English

Twilio for Python安装错误(Win10)

[英]Twilio for Python installation errror (Win10)

I successfully added python to my PATH. 我成功地将python添加到了PATH中。 I found these instructions on https://www.twilio.com/docs/python/install#installation . 我在https://www.twilio.com/docs/python/install#installation上找到了这些说明。

I get the following error when I try to run the following command on my Command Prompt : 当我尝试在命令提示符上运行以下命令时,出现以下错误:

python setup.py install

Error : 错误:

C:\Python27>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    with open('twilio/version.py') as f:
IOError: [Errno 2] No such file or directory: 'twilio/version.py'

I also took out the setup.py file from the twilio folder and placed it into C:\\Python27 directory. 我还从twilio文件夹中取出了setup.py文件并将其放入C:\\Python27目录中。

Why is this error occuring ? 为什么会出现这个错误?

It's better to install it via pip: 最好通过pip安装它:

pip install twilio 

If you must install it from source, first unpack the source code from the zip archive. 如果必须从源代码安装它,请首先从zip存档中解压缩源代码。 Then locate the setup.py file. 然后找到setup.py文件。 You need to run it in the same directory. 您需要在同一目录中运行它。 So for example, if you unpacked twilio to D:\\twilio and your setup file path is D:\\twilio\\setup.py , you first need to change directory to there. 因此,例如,如果您将twilio解压缩到D:\\twilio并且您的安装文件路径是D:\\twilio\\setup.py ,则首先需要将目录更改D:\\twilio\\setup.py目录。

cd D:\twilio\setup.py
python setup.py install

Looks like you tried to copy the setup.py file to your Python installation folder and tried to run it from there. 看起来你试图将setup.py文件复制到Python安装文件夹并尝试从那里运行它。 That will not work since the setup file depends on other files in that unpacked source directory. 这不起作用,因为安装文件依赖于该解压缩的源目录中的其他文件。

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

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