Questions tagged [pkg-resources]
92 questions
1
vote
1 answer
How to be able to access data files in all install and distribution cases with setuptools?
I'm kind of lost in all the locations you can add data files.
First, there is the MANIFEST.in file. As I understand, this is only to specify source files to be included in "source distribution".
Then, there is the data_files argument to setup()…

hl037_
- 3,520
- 1
- 27
- 58
1
vote
1 answer
find pip packages: pkg_resources specify custom target directory
Is there any way to specify a custom target directory for pkg_resources to list pip packages? I want to be able to find packages which have been installed in a custom target directory using --target through something like pkg_resources.require()…

hiradyazdan
- 171
- 1
- 13
1
vote
0 answers
Missing pkg_resources.py31compat
I tried to set up a virtualenv and I have setuptools (39.0.1). And I got
In [1]: import pkg_resources.py31compat
---------------------------------------------------------------------------
ImportError Traceback (most…

kawingkelvin
- 3,649
- 2
- 30
- 50
1
vote
1 answer
Print information from exception in pkg_resources
I'd like to check if all required modules are installed in the correct version using pkg_resources.require. It all works fine, but I don't know how to print out the information if pkg_resources raises a pkg_resource.VersionConflict.
This example…

AndiGasman
- 113
- 2
- 9
1
vote
1 answer
Calculate directory path in Python module distribution
I have a Python module distribution (it's an egg) that contains some additional files & directories that I would like to copy during my program's runtime.
├── mypkg
│ ├── extra_files
│ │ ├── layouts/
│ │ ├── scripts/
│ │ └──…

accraze
- 1,522
- 7
- 20
- 46
1
vote
3 answers
How to access a module installed by setuptools' install_requires within setup.py?
I'm writing a setup.py to install my package reboundx, which has a single dependency, rebound. My package builds an extension libreboundx.so that needs to link to librebound.so in setup.py
rebxExt = Extension('libreboundx', libraries=['rebound'],…

Dan
- 2,851
- 3
- 20
- 27
1
vote
0 answers
Should pkg_resources.DefaultProvider work with namespace packages?
I have a namespace package, and in one of the packages in that namespace I have a Jinja2 template. I am using jinja2.PackageLoader to load it.
However, if I create a jinja2.PackageLoader('namespacepackage') and then try to list_templates(), it fails…

Lev Levitsky
- 63,701
- 20
- 147
- 175
1
vote
1 answer
Cannot start new Django project
I already have a website running under Django. It is a full project with many applications. Now I want to start a new project, so I type
django-admin startproject exampleProject
But I receive an error message:
Traceback (most recent call…

Eric Luther
- 117
- 1
- 10
1
vote
0 answers
python pkg_resources does not seem to respect sys.path
I'm using Python 2.7 and trying to run
pkg_resources.get_distribution(appname).version
over multiple apps.
I thought I would be able to do this by manipulating sys.path within the program but it doesn't seem to be recognized by pkg_resources; I can…

Mark McWiggins
- 621
- 6
- 20
1
vote
1 answer
pkg_resources not found after installing setuptools
I am trying to compile and install python2.6.4 on Debian 5.0.3 (64bit). I installed using 'make altinstall' as I want to keep python 2.5.2 that comes with Deb5.0 as my default python.
Following this, I installed setuptools 0.6c11 using the command…

Ethan
- 4,915
- 1
- 28
- 36
1
vote
1 answer
Beautiful Soup and pkg_resources
I'm trying to use Beautiful Soup. I installed in my mac terminal easy_install following the instructions, and while the process seem to go fine, when I try to import from bs4, had an ImportError, saying that such module did not exist.
I google it…

user2832534
- 21
- 3
1
vote
1 answer
Python setuptools entrypoints and subapplications as child processes
I'm working on Windows and developing an application that will be distributed to end users.
I have one setupttools distribution that contains a nandful of python packages. This distribution declares some console_scripts entrypoints that point to…

EB.
- 3,383
- 5
- 31
- 43
1
vote
1 answer
How to implement resource_filename in pkg_resources?
I wrote a package that imports pkg_resource package provided by distribute 0.6.35. I import pkg_resource because I need its resource_filename to get the path of a built-in data. However, the pkg_resource is not built-in in python3 and need to…

Hanfei Sun
- 45,281
- 39
- 129
- 237
0
votes
0 answers
AttributeError: module 'pkg_resources' has no attribute 'appdirs'
I am getting following error, could not find any solution, can anyone assist in this?
AttributeError Traceback (most recent call last)
/tmp/ipykernel_10658/1029138787.py in
2 import datetime
3 import…

ankush
- 1
0
votes
1 answer
Implement pkg_resources.resource_filename in setuptools
I am working to incorporate the symspellpy package for spell checking and correcting large amounts of data. However, the package suggests using pkg_resources.resource_filename, which is no longer supported. Can you please provide guidance on how to…

Francis Smart
- 3,875
- 6
- 32
- 58