Question

How can I direct pip to find setup.py? My setup.py file is located ~/setuptools-3.5.1.

I ran

dustin@dustin:~$ python setuptools-3.5.1/setup.py egg_info
running egg_info
writing requirements to setuptools.egg-info/requires.txt
writing setuptools.egg-info/PKG-INFO
writing top-level names to setuptools.egg-info/top_level.txt
writing dependency_links to setuptools.egg-info/dependency_links.txt
writing entry points to setuptools.egg-info/entry_points.txt
reading manifest file 'setuptools.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'setuptools.egg-info/SOURCES.txt'
dustin@dustin:~$ 

so it looks as everything is okay, but when I run pip, I get

Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/dustin/.pip/pip.log

I am under the impression that when I run pip it isn't finding setup.py

Was it helpful?

Solution 2

matplotlib has many external dependencies. Some of these are required. You can see the list of required ones in the log file produced by the attempted pip install. In your case, it is this:

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.8.1]
              dateutil: yes [dateutil was not found. It is required for date
                        axis support. pip/easy_install may attempt to
                        install it after matplotlib.]
               tornado: yes [using tornado version 3.2.1]
             pyparsing: yes [pyparsing was not found. It is required for
                        mathtext support. pip/easy_install may attempt to
                        install it after matplotlib.]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [pkg-config information for 'freetype2' could
                        not be found.]
                   png: yes [pkg-config information for 'libpng' could not
                        be found. Using unknown version.]

also

============================================================================
                        * The following required packages can not be built:
                        * freetype
Complete output from command python setup.py egg_info:
============================================================================

Here, you can see that freetype couldn't be found. You need to install it on your system.

OTHER TIPS

Navigate to the directory that contains your setup.py and run:

pip install -e .

Had the same problem. This is probably because some of the dependencies may not be installed. Solved this by installing using package manager in ubuntu. Use the following command

sudo apt-get install python-matplotlib

Hope this helps.

Navigate to the directory that contains your setup.py and run:

pip install -e .

this worked for me. But still i got the massage setup.py not found when i used "pip install -e '.[all]' " in the anaconda environment terminal. Instead i used "pip install gym[all]" and it worked !

In my case the error was related to "File 'setup.py' not found.", but I did not expect it to find setup.py, and the issue was fixed when I updated pip to a version (>21.3) that could use pyproject.toml instead

For me the project (arelle) does not have a setup.py file. That's because arelle uses pyproject.toml file instead.

So I expected setup.py would not be found. But I didn't know why pip couldn't use pyproject.toml instead.

I learned from a StackOverflow comment that "Pip supports editable installs from pyproject.toml files since 21.3

Changelog [pip documentation]

21.3 (2021-10-11)

Support editable installs for projects that have a pyproject.toml and use a build backend that supports PEP 660. (#8212)

My pip is version 18.1, so that's probably the reason:

$ pip --version
pip 18.1 from C:\ProgramData\Anaconda3\lib\site-packages\pip (python 3.7)

I'll upgrade my pip and try again... Yes, I upgraded pip ...

$ python -m pip install --upgrade pip
$ pip --version
pip 23.0.1 from c:\programdata\anaconda3\lib\site-packages\pip (python 3.7)

and now I could do this workflow:

$ git clone https://github.com/Arelle/Arelle.git
$ cd arelle
$ pip install -e .

(Maybe I could've used the shortcut recommended on the arelle project: pip install git+https://git@github.com/arelle/arelle.git@master This method failed for me the first time (because "File could not be found!", presumably because of an old version of pip!)

More on python packages here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top