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.
Related
I want to install this Python package from a private repository.
I tried multiple ways addressed here.
However, I got following errors:
1.
MakotonoMacBook-ea:~ makotomiyazaki$ pip install https://github.com/nealjean/coreg.git
Collecting https://github.com/nealjean/coreg.git
Downloading https://github.com/nealjean/coreg.git
\ 102kB 955kB/s
ERROR: Cannot unpack file /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-unpack-hl6ejff8/coreg.git
(downloaded from /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-req-build-0xy7h6hv, content-type: text/html; charset=utf-8);
cannot detect archive format
ERROR: Cannot determine archive format of /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-req-build-0xy7h6hv
2.
MakotonoMacBook-ea:~ makotomiyazaki$ pip install git+https://github.com/nealjean/coreg
Collecting git+https://github.com/nealjean/coreg
Cloning https://github.com/nealjean/coreg to /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-req-build-zvs4cg3t
Running command git clone -q https://github.com/nealjean/coreg /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-req-build-zvs4cg3t
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/makotomiyazaki/anaconda3/lib/python3.6/tokenize.py", line 452, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-req-build-zvs4cg3t/setup.py'
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_f/ds87hcrj1d3023gdtg72nb7w0000gn/T/pip-req-build-zvs4cg3t/
3.
MakotonoMacBook-ea:~ makotomiyazaki$ pip install -e git+https://github.com/nealjean/coreg
ERROR: Could not detect requirement name for 'git+https://github.com/nealjean/coreg',
please specify one with #egg=your_package_name
I referred to several other methods suggested such as this, but didn't solve my problem.
Does anyone know the cause and the solutions?
I am using Python 3.6.8
The repository doesn't have setup.py, it cannot be installed with pip.
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
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'
I am trying to install behave-parallel using pip install. I have installed programmes previously using pip so I know my Python/script path is correct in my env variables. However I am seeing the following error
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\.....Temp\\pip-install-rjiorrn7\\behave-parallel\\setup.py'
how can I resolve this issue
C:\Users\.....>pip install behave-parallel
Collecting behave-parallel
Using cached https://files.pythonhosted.org/packages/05/9d/22f74dd77bc4fa85d391564a232c49b4e99cfdeac7bfdee8151ea4606632/behave-parallel-1.2.4a1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\.........\python\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\.........\\AppData\\Local\\Temp\\pip-install-7vgf8_mu\\behave-parallel\\setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\.........\AppData\Local\Temp\pip-install-7vgf8_mu\behave-parallel\
In my case with the same error, the solution was to do
pip3 install --upgrade pip
It was my pip3 that was in version 9.X were it's now in version 19.X
The package is simply broken, as it is missing the setup.py file.
$ tar tzvf behave-parallel-1.2.4a1.tar.gz | grep setup.py
$
You might be able to download the source from Github or wherever and package it yourself (python setup.py bdist_wheel), then install that wheel (pip install ../../dist/behave-parallel...whl).
There is a newer feature for building python packages (see also PEP 517 and PEP 518). A package can now be built without setup.py (with pyproject.toml), but older pip versions are not aware of this feature and raise the error shown in the question.
So if you have reason to believe that the library was packaged properly, try updating pip to something newer (version 19 or newer will probably work).
Here it seems caused by setup.py not being in the root of my project.
(it can't be in root because otherwise the unit test will "discover" setup.py and fail it because it's not a test)
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.