Questions tagged [pkg-resources]

92 questions
3
votes
2 answers

IPython NameError: name 'pkg_resources' is not defined

Out of the blue my IPython Kernel stopped working, repeatedly failing to restart. The error message is shown below. I have no idea what triggered this, and how to fix it. I tried upgrading setuptools and distribute as some other posts had mentioned,…
shayne13
  • 31
  • 1
  • 3
3
votes
1 answer

How to make source-controlled pip packages fulfill other packages' requirements

When a package is installed from a repository, pip freeze yields a repository path for that package rather than a package name/version. Example: -e…
Ryne Everett
  • 6,427
  • 3
  • 37
  • 49
3
votes
1 answer

python: How to check extra requirements at runtime?

Our main application has some extra features, that users can enable. Those features are in their own directory. Those features might need extra dependencies. I am considering to put those in a requires.txt file there. At runtime, we would like to…
Elrond
  • 901
  • 9
  • 23
2
votes
0 answers

Using multiple versions of one package

I recently tried to install neuralcoref to use with the NLP package spaCy. The problem is that neuralcoref only works with spaCy versions >=2.1.0 and <2.2.0. My current version is way above that and includes features I wouldn't want to…
2
votes
1 answer

Version conflicts for Python apps but not for interactive development

I have a package P that depends on a package A. Package A depends on packages B and C==3. At the same time, Package B depends on C==4. This creates conflicts and an akward error message is shown in red every time I pip install packages P or A. Now,…
srcolinas
  • 497
  • 5
  • 13
2
votes
1 answer

xattr: ImportError: No module named pkg_resources

I was trying to run xattr on macOS Catalina 10.15.2 and the error occurred: Traceback (most recent call last): File "/usr/bin/xattr", line 8, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources So…
Francis He
  • 23
  • 4
2
votes
1 answer

fragile console script: pkg_resources.DistributionNotFound

If I create console_scripts via entry_point in setup.py, then this file gets created: #!/home/myproject_cok_d/bin/python # EASY-INSTALL-ENTRY-SCRIPT: 'mylib','console_scripts','do-magic' __requires__ = 'mylib' import re import sys from pkg_resources…
guettli
  • 25,042
  • 81
  • 346
  • 663
2
votes
1 answer

"ImportError: No module named pkg_resources" when importing google.cloud.datastore

I am attempting to use the Google Cloud Datastore, but importing google.cloud.datastore gives an ImportError: ERROR 2018-03-13 19:28:29,013 wsgi.py:263] Traceback (most recent call last): File…
2
votes
0 answers

Error when calling Pkg_resources.resource_string

I'm a little confused. I'm working on a Python project where I load a resource file, read it as tsv and transform it into a dictionary with pattern objects as key for later usage. To load the file, so far I've used the pkg_resources package from…
styps
  • 279
  • 2
  • 14
2
votes
0 answers

How do I access data files with pkg_resources?

My package looks somewhat like this. Package tokenizer,py corpus.py __init__.py resources data.txt I want to access data.txt from corpus.py. How should I do it with pkg_resources? Also do I need to create setup.py for package…
2
votes
1 answer

Mac OS X: ask for configuration during pkg install

I used Packages to create a.pkg installer for a Mac OS X LaunchDaemon. During install, I would like the user to be able to provide a few values for the configuration file. The resulting file is a simple text configuration file which will be sourced…
mivk
  • 13,452
  • 5
  • 76
  • 69
2
votes
0 answers

setuptools/pkg_resources deactivate distribution

I've been playing with the setuptools pkg_resources module to load plugin functions via entry points. It seems that once an entry point has been loaded, the specific distribution used to get that entry point is now "active" (and therefore saved in…
barrett
  • 31
  • 2
2
votes
0 answers

pkg_resources error when trying install anything with easy_install or PIP

when in python IDE i print where pkg_resources is located it prints out this >>> import pkg_resources >>> print pkg_resources.__file__ /Library/Python/2.7/site-packages/setuptools-2.1-py2.7.egg/pkg_resources.pyc but when I try to navigate to the…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
2
votes
1 answer

what is this error pkg_resources distribution not found?

I can import pkg_resources in shell but I don't know why do I get this error when I try to run pylint and some many there tools... Traceback (most recent call last): File "/usr/local/bin/pylint", line 5, in from pkg_resources import…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
2
votes
0 answers

pkg_resources.find_distributions("/dirpath with sdist zip file")

It seems i am not able to obtain the Distribution information from pkg_resources.find_distributions("/dirpath with sdist zip file"). can someone shed me some light?