FAQ Database Discussion Community


Python & setuptools - 'No module named…'

python,setuptools
I'm trying to package an app I've written in Python, and am using setuptools with find_packages to do so. If I run python setup.py develop (or install) I get an ImportError: Traceback (most recent call last): File "c:\Python34\Scripts\jiragen-script.py", line 9, in <module> load_entry_point('jiragen==1.0', 'console_scripts', 'jiragen')() File "x:\jira\jiragen\jiragen\main.py", line 8, in...

Python's setup.py installed CLI script doesn't allow importing same module

python,module,setuptools
I want to create a python app named knife that can be executed from CLI, the problem is that it can't import the modules. I followed the same folder structure as the Django project for reference. My directory structure is like this: knife/ knife/ bin/ knife-cli.py core/ main/ __init__.py __init__.py...

What is the purpose of setuptools requirements of the form “package===version”

python,setuptools
Say I have a package with a console script such as from setuptools import setup setup( name='eg_package', version='0.0.1', description='Trivial test package', packages=[ 'eg_package', ], entry_points={ 'console_scripts': [ 'foo = eg_package.main:main', ] }, ) If I set and explicit build tag using egg_info -b mytag the resulting script has __requires__ =...

Making a neat, installable Python library with Click

python,click,command-line-interface,setuptools
I'm trying to make a command line tool with Click in Python, and I can't seem to find any documentation on packaging up the library into something that's installable. Is there any way to do this? At the moment I'm just using a virtual environment and installing it for testing...

setuptools python setup.py install not copying all child modules

python,setuptools
The package dir structure is this repodir/ -------- setup.py -------- MANIFEST.in -------- bin/ ----------- awsm.sh -------- sound/ ------------ init.py ------------ echo/ ----------------- init.py ----------------- module1.py ----------------- module2.py ------------ effects/ ------------------- init.py ------------------- module3.py ------------------- module4.py setup.py from setuptools import setup setup( name = 'sound', version = '0.1', author = 'awesomeo',...

Can I get pip to delete scripts that I installed but no longer want?

python,setuptools
Say I have the following project: confectionary/ __init__.py confections.py scripts/ crunchy_frog.py anthrax_ripple.py spring_surprise.py And it has been installed by my users, so they can simply type $ spring_surprise.py and have stainless steel bolts spring out of their computer, piercing both cheeks. However, Constable Parrot has convinced me to move into...

Dependencies from git aren't being installed?

python,python-2.7,pip,setuptools,distutils
p0 depends on p1, which in turn depends on p2. p2 isn't getting installed, everything else is. I.e.: I get an ImportError in reference to p2 when I deploy p0 via Heroku. Note that all have lines in their requirements.txt like so: git+http://github.com/project/package Additionally I have tried putting everything in...

Including logging.conf in setup.py?

python,python-2.7,setuptools,distutils,data-files
In my package_name subdirectory (one below "setup.py") I have a "logging.conf" file. How do I include it in my setup? Attempt from distutils.sysconfig import get_python_lib data_files=[(path.join(get_python_lib(), package_name), path.join(path.dirname(__file__), package_name, 'logging.conf')) Preferably it should be something simple like: data_files = [(package_name, path.join('.', package_name, 'logging.conf'))] Error error: can't copy 'c': doesn't exist...

Installed module is empty

python,setuptools
I'm tring to use setuptools for python3 code. My project structure: ./testSetup/ ./testSetup/testSetup ./testSetup/testSetup/foo.py ./testSetup/Setup.py ./testSetup/testSetup/foo.py content: def say_foo(): print('foo') ./testSetup/Setup.py content: from setuptools import setup, find_packages import testSetup setup( name='testSetup', version='0.0.1', packages=find_packages(), author='Bastien Sevajol', author_email="[email protected]", description='test', long_description='test test', include_package_data=False, url='http://bux.fr', #...

How to “fake” a module safely in a Python package

python,git,packages,setuptools
Currently I have the following directory structure in the master git branch: /dir1 __init__.py module.py This will be changed to (in my branch): /dir1 __init__.py /dir2 module1.py # With 70% of code of module.py module2.py # With 30% of code of module.py Issues: I know its not possible to make...

how do i control to which python to install a package

python,setuptools,distutils,setup.py,mosek
i'm on win7/64, and have some pythons already, but want to be installing mosek to a new WinPython >where python C:\Users\nlab\Downloads\WinPython-64bit-2.7.9.5\python-2.7.9.amd64\python.exe C:\Python27\python.exe C:\Program Files (x86)\LilyPond\usr\bin\python.exe i'm following these instructions >cd C:\Program Files\Mosek\7\tools\platform\win64x86\python\2 >python setup.py build --build-base c:\Users\nlab install --user running build running build_py creating c:\Users\nlab\lib creating c:\Users\nlab\lib\mosek copying mosek\array.py...

setup.py check if non-python library dependency exists

python,setuptools,distutils,setup.py,cgal
I'm trying to make a setup.py for cgal-bindings. To install this, the user needs to have at least a certain version of CGAL. In addition, CGAL has a few optional targets that should be built if the user has some libraries (like Eigen3). Is there a cross-platform way in Python...

Python installed package won't import modules

python,module,packages,setuptools
I want to create a python app named knife that can be executed from CLI, the problem is that it can't import the modules. My file structure is like this: my_project/ knife/ __init__.py knife.py external.py setup.py My setup.py looks like this: #!/usr/bin/python from setuptools import setup, find_packages setup(name='Knife', version='0.3', description='Very...

Python dependencies: Merging two packages into one

python,pip,setuptools
I have two python packages A and B that I would like to merge together into A, i.e. all functionality of B is now reachable in A.B. Previously, A-1.0 depended on B-1.0. Now I want to avoid, that users of A-2.0 still have B-1.0 installed and I don't know how...

ImportError when using console_scripts in setuptools

python,setuptools
I am trying to build a program called dnsrep in Python, I am using setuptools so that I can call the dnsrep module without using the command python dnsrep. The setup.py script I wrote is given below: from setuptools import setup, find_packages setup( name='dnsrep', version='0.1', description='Program that gives a reputation...

error while accessing method of class - python package

python,python-2.7,setuptools
I have uploaded a simple package to https://testpypi.python.org/pypi . I have followed following steps, python setup.py register -r https://testpypi.python.org/pypi python setup.py sdist upload -r https://testpypi.python.org/pypi Then downloaded this package to locally and executed setup.py with install command. ( package url https://testpypi.python.org/pypi/printlistonlynew/0.1 ) And then package was installed successfully. Here is...

pip command is not being recognized

python,django,pip,setuptools
I am installing python and Django on my shared host server. I have followed the guide located here to install python and pip http://flailingmonkey.com/install-django-justhost/ As I've encountered the problem of python never using 3.4.2 I've followed a different guide to install python 3.4.2 which is here http://joemaller.com/1717/building-python-on-shared-hosting/ After I installed...

Permission denied Setuptools

python,django,curl,setuptools
I'm trying install setuptools in my Mac, but when I run command curl https://bootstrap.pypa.io/ez_setup.py -o - | python show a message telling: Processing setuptools-17.1.1-py3.4.egg Removing /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools-17.1.1-py3.4.egg Copying setuptools-17.1.1-py3.4.egg to /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages Adding setuptools 17.1.1 to easy-install.pth file error: [Errno 13] Permission denied:...

What's the minimal directory structure to make setuptools work with one_file.py?

python,pip,setuptools,distutils
one_file.py contains some general functions, classes, and a main(). I'd like to make it pip installable with a command line script that calls the main() function. What's a directory structure and setup.py that will do this?...

Installing another source distribution in setup.py?

python,setuptools,setup.py
I have a dependency that's not on PyPi, but I have it in a source distribution tar file. Is there anyway to get setup.py to use the tar to install the dependency? This doesn't work because dependency.tar.gz is not available after the project gets into an sdist: from setuptools.command.install import...

`python -m ensurepip --upgrade` does not seem to be upgrading pip and setuptools

python-2.7,pip,homebrew,setuptools,python-3.4
I am on a Mac running Yosemite (Mac OS X 10.10.1) and homebrew installed python and python3 and python -m ensurepip --upgrade does not seem to be working as I would have expected. python -m ensurepip --upgrade does not upgrade pip or setuptools. pip install --upgrade pip setuptools upgrades pip...

Python custom module installalation won't copy static files

python-2.7,setuptools,python-module,pypi
hi I'm developing a python module and when I create the install package using python setup.py sdist bdist_egg all the files are included on the zip file, but when I run python setup.py install all files are copied except the static files. the full project is on: https://github.com/efirvida/python-gearbox my setup.py...

Simple way to install a setuptools python module without root access?

python,setuptools
Say I a have python module with a proper setup.py which I would like to install to my own user. However a simple installation will fail as such, since it attempts to install globally on my system % python setup.py install running install running build running build_py creating build creating...

Workflow when developing a packaged django application

python,django,setuptools
I'm trying to develop a django application to share with a project team. At this point, I have the alpha release of the application ready to share. Following the instructions on how to package a django app, I copied it to a separate folder, made all the files, and ran...

sdist correct but pip install no static

python,pip,setuptools,pypi
I am trying to deliver a Django app via pip (stored on Pypi). The problem is that when I install the app with pip, it does not contain the static folder inside of the main specified package. Here is what I have: ├── LICENSE.txt ├── MANIFEST.in ├── README.rst ├── setup.cfg...

Install a CMake macro script from within a python package install script (using setup.py)

python,cmake,setuptools,distutils,setup.py
So I have a Python package – it’s all set up on PyPI, and on GitHub, no problem. This is something I’m relatively familiar with. What is unknown to me is: the notion of installing a CMake script as part of the python package install process. The python package in...

Is Python's setup.py beneficial for internal applications?

python,python-3.x,setuptools,setup.py
I'm in the midst of writing our build/deployment scripts for a small Python application that will be run multiple times per day using a scheduled task. I figure now is as good a time as ever to investigate Python's setup.py feature. My question is, is there any sort of benefit...