Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pkg_resources.ResolutionError not found

I tried install a package in python3 called Spexxy, using this:

pip3 install -r requirements.txt
python3 setup.py install

Using iPython in the shell, I can well import the package with import spexxy but when I try to use anything from the package, first I have to use an exclamation point before the command like for example !spexxytools grid create, otherwise I have the error:

File "<ipython-input-3-b744a07ba8b3>", line 1
    spexxytools grid create --from-filename "lte(?P<Teff>\d{5})-(?P<logg>\d\.\d\d)(?P<FeH>[+-]\d\.\d)(\.Alpha=(?P<Alpha>[+-]\d\.\d\d))?\.PHOENIX"
                   ^
SyntaxError: invalid syntax

But even when using the exclamation point, I now have the error:

  File "/home/geoffrey/.local/bin/spexxy", line 4, in <module>
    __import__('pkg_resources').run_script('spexxy==2.3', 'spexxy')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 658, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1429, in run_script
    .format(**locals()),
pkg_resources.ResolutionError: Script 'scripts/spexxy' not found in metadata at '/home/geoffrey/.local/lib/python3.6/site-packages/spexxy-2.3.dist-info'

Can you help me find what's wrong ?

like image 969
Geo573 Avatar asked Dec 03 '25 03:12

Geo573


1 Answers

setuptools.find_packages()

Packages are only recognized if they include an init.py file.

So if you put

...
packages = setuptools.find_packages(),
...
scripts=['scripts/spexxy'],

you will get this error.

To fix it either write spexxy as a module in your source or declare packages = manually instead of using find_packages().

Edit

spexxy setup.py is using

    packages=find_packages(include=['spexxy', 'spexxy.*']),
    scripts=['bin/spexxy', 'bin/spexxytools'],

But the bin directory is missing, so it should be:

    packages=find_packages(include=['spexxy', 'spexxy.*', 'bin/*']),
    scripts=['bin/spexxy', 'bin/spexxytools'],
like image 174
noraj Avatar answered Dec 04 '25 17:12

noraj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!