Twilio for Python installation errror (Win10) - python

I successfully added python to my PATH. I found these instructions on 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.
Why is this error occuring ?

It's better to install it via pip:
pip install twilio
If you must install it from source, first unpack the source code from the zip archive. Then locate the setup.py file. 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.
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. That will not work since the setup file depends on other files in that unpacked source directory.

Related

IOError: [Errno 2] No such file or directory: 'requirements.txt' (no module named c)

Trying to run some code for a GUI which occasionally works if I run it as a notebook file (other times it attempts to compile and nothing happens).
Im trying to run it as a .py file and I get an error where module "c" is trying to download but fails because "requirements.txt" doesn't exist.
Im using anaconda(gl-env)2.7 as my project interpreter and have attempted to install/find the requirement.txt file using:
pip install -r requirements.txt
I get the error that the file/directory doesnt exist.
When I run my program this is the error I get:
Collecting c
Downloading https://files.pythonhosted.org/packages/fc/5f/1130c201f3138745970f8de520095a942cdd174e8f84faf04ce77c434d8d/c-0.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Tommy\AppData\Local\Temp\pycharm-packaging\c\setup.py", line 6, in <module>
with open('requirements.txt') as fh:
IOError: [Errno 2] No such file or directory: 'requirements.txt'
Per the PKG-INFO for this module:
## Installing
This is a python 3 package, and requires python 3.5.
To install, type in the terminal:
pip3 install c
Doesn't look like you can use this for 2.7. As a note, I did not pip install, I just ran
curl --output c-0.1.0.tar.gz https://files.pythonhosted.org/packages/fc/5f/1130c201f3138745970f8de520095a942cdd174e8f84faf04ce77c434d8d/c-0.1.0.tar.gz
to download the tar archive

how to customise files being copied into tmp directory when running a local pip install?

I'm trying to pip install the python binding of MXNet library from source code:
https://mxnet.incubator.apache.org/install/ubuntu_setup.html#install-mxnet-for-python
After the main binary is built successfully using g++, there is no problem in installing its python binding in dev/editable mode:
pip install -e .
however when I try to deploy the full package (instead of just creating a symbolic link)
pip install .
I encounter the following error:
Processing ~/git-fork/mxnet/python
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-k3hfc693/setup.py", line 47, in <module>
LIB_PATH = libinfo['find_lib_path']()
File "/tmp/pip-req-build-k3hfc693/mxnet/libinfo.py", line 74, in find_lib_path
'List of candidates:\n' + str('\n'.join(dll_path)))
RuntimeError: Cannot find the MXNet library.
List of candidates:
/tmp/pip-req-build-k3hfc693/mxnet/libmxnet.so
/tmp/pip-req-build-k3hfc693/mxnet/../../lib/libmxnet.so
/tmp/pip-req-build-k3hfc693/mxnet/../../build/libmxnet.so
../../../libmxnet.so
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-k3hfc693/
It appears that pip didn't copy ../../lib/libmxnet.so into tmp since it is outside the python package directory. What should I do to instruct pip to copy that file (and if possible, everything under parent directory) when installing?
Where is your libmxnet.so located? It should be in the main-directory, so in your case: /git-fork/mxnet. Then the setup.py script should work out of the box. You could also manually set the path in setup.py, by adjusting the following line LIB_PATH = libinfo'find_lib_path'

Error when downloading package using git+ssh

I am working on creating a private package repository for my company and am trying to download the package from Github. I believe the package should compile, as I have uploaded this as a test function to PyPI.
The error I get is: FileNotFoundError: [Errno 2] No such file or directory: setup.py I am cloning the repo back into the exact same environment in which the function was created - what could be wrong?
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\tokenize.py", line 454, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory:
'C:\\Users\\ALLENB~1\\AppData\\Local\\Temp\\pip-07k46aoa-build\\setup.py'
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\ALLENB~1\AppData\Local\Temp\pip-07k46aoa-build\setup.py
setup.py is not part of the Python/Anaconda 3 installation location!
It's included with the package that you wish to install. Change directories to the location of the source that you download it with pip install (or with: py -m pip install) and then run the setup.py file.
EDIT:
Add #subdirectory=folder_name to your code.

Error while trying to port a repo from github

There is a github code I am trying to use that is located here.
I am trying to run params.py which is a code that will take a binary file and converts it so that I can plot it (or so I think).
I tried to run:
pip install git+https://github.com/PX4/pyulog.git
However, that gave me an error:
C:\Users\Mike\Documents>pip install git+https://github.com/PX4/pyulog.git
Collecting git+https://github.com/PX4/pyulog.git
Cloning https://github.com/PX4/pyulog.git to c:\users\mike\appdata\local\temp\pip-t_vvh_b0-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Anaconda3\lib\tokenize.py", line 454, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Mike\\AppData\\Local\\Temp\\pip-t_vvh_b0-build\\setup.py'
Pip install tries to install the module from :
PyPI (and other indexes) using requirement specifiers.
VCS project urls.
Local project directories.
Local or remote source archives.
When looking at the items to be installed, pip checks what type of item each is, in the following order:
Project or archive URL.
local directory (which must contain a setup.py, or pip will report an error).
Local file (a sdist or wheel format archive, following the naming conventions for those formats).
A requirement, as specified in PEP 440.
In your case, git repo doesn't meet the requirement. It doesn't have setup.py that's why you get the error.
Instead try cloning the repo on your local machine.

pip install from shortened url

I have put my wheel file at http://long.url.name.com/package-cp27-none-linux_x86_64.whl, and when I do pip install http://long.url.name.com/package-cp27-none-linux_x86_64.whl, it works great. However, when I have a URL shortener forward the above URL and get something like http://short.url/XYZ, and try to do pip install http://short.url/XYZ, pip doesn't work. I notice the download activity, but I see the following error from pip :
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 18, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-2LPqrK-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-2LPqrK-build
The problem seems to be that the filename that pip sees for the file is XYZ. This is true when I try to download the file using wget, for instance. However, when I got to http://short.url/XYZ, the file indeed gets downloaded and saved as package-cp27-none-linux_x86_64.whl. So how can I make pip work with the shortened URL?
So it appears that pip cares about the format of the file at the end of the url
so https://aka.ms/foo-1.0.0-py3-none-any.whl works. but if you just have a hask then

Categories