Menu
  • HOME
  • TAGS

Python installed package won't import modules

python,module,packages,setuptools

The external.py should be shipped too. So the setup.py added the external.py: scripts=['knife/knife.py', 'knife/external.py'], ...

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

python,setuptools

Use the --prefix option like: python setup.py install --prefix ~/.local EDIT: This is similar to using --user, which uses the user specific site-package (defined to be ~/.local on *nix as per PEP 370) automatically....

Python module: use during setup but not to be installed

python,setuptools

You can include source distribution files in the MANIFEST.in file; these files are included when building a source distribution that includes the setup.py file. Do not include the file in data_files or package_data or py_modules and it won't be included in the binary distribution (just like setup.py won't be)....

Including logging.conf in setup.py?

python,python-2.7,setuptools,distutils,data-files

Do you want to include logging.conf within your package distribution? Use the package_data argument to setup(): setup( name = "package-name", packages = ["packagename"], package_data= { "packagename": [ "resources/foo.bar", "resources/static/css/*", "README.md", "logging.conf" ]}, ... ) ...

setup.py check if non-python library dependency exists

python,setuptools,distutils,setup.py,cgal

Whether a particular extension module should be compiled depending on the availability of some library version, can be accomplished by dynamically generating the ext_modules argument of setup() in setup.py. For the _yaml.so module of ruamel.yaml, that only should be compiled when the libyaml development libraries have been installed on the...

Python setuptools: install pacakge dependencies from a local repository

python,python-2.7,dependencies,setuptools,pypi

With PIP cache you could install the dependencies more one time. Adding to ~/.bash_profile the next line: export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache See the next link http://stackoverflow.com/a/4806458/3380763...

RPM subpackages from a Python project

python,package,rpm,setuptools,distutils

No, distutils and its derivatives do not support that. You would have two codebases, each with a setup.py script, producing two different sets of sdists/wheels/RPMs. Or you could have one repository with e.g. setup_client.py and setup_server.py scripts (with different package name and list of files to package), but that is...

Python dependencies: Merging two packages into one

python,pip,setuptools

I think, you can't! (at least without using such tricks, as you described). The Python package system has (to my knowledge) no such notion as "allowed" packages. There could be a person, that invents a different package C that he calls B, but with totally different functionality. Such a notion...

sdist correct but pip install no static

python,pip,setuptools,pypi

Solution with Distutils # MANIFEST.in include LICENSE.txt include README.rst # recursive-include zxcvbn_password/static * and # setup.py from distutils.core import setup setup( name='django-zxcvbn-password', packages=['zxcvbn_password'], package_data={'': ['static/zxcvbn_password/js/*.js']}, # include_package_data=True, url='https://github.com/Pawamoy/django-zxcvbn-password', # and other data ... ) I commented out the recursive-include line from MANIFEST.in and the include_package_data=True from setup.py: apparently they are...

Installed module is empty

python,setuptools

You need to have an __init__.py file in your TestSetup/ directory (the file can be blank). Otherwise, nothing in that directory will be importable and find_packages() will never find it. You might want to read about it. ./testSetup/ ./testSetup/testSetup ./testSetup/testSetup/__init__.py ./testSetup/testSetup/foo.py ./testSetup/setup.py Also note that setup.py should be all lowercase....

Cython conditional compile based on external value given via setuptools

python,cython,setuptools,conditional-compilation

Thank you for the link The interesting flag in the setup.py is cython_compile_time_env. And to import the Extension from cython. from setuptools import setup from Cython.Distutils.extension import Extension ext = Extension( name, include_dirs=include_dirs, cython_compile_time_env={'OPENMP': True}, sources=['test.pyx']) setup(name=name, cmdclass={"build_ext": build_ext}, ext_modules=[ext]) And in the test.pyx: ... IF OPENMP: #Do openmp ELSE:...

How do I get easy_install to use the right version of setuptools?

python,setuptools,easy-install

You have to remove the older versions of setuptools. Sometime it is not so easy and it might need to try: removing it by installation program you used to install it (brew?, apt-get...) deleting it manually from directories incl. scripts, which are installed in your system (finding them by which...

setuptools python setup.py install not copying all child modules

python,setuptools

Add sound.echo and sound.effects to packages. distutils won't recursively collect sub-packages. As per the fine documentation: Distutils will not recursively scan your source tree looking for any directory with an __init__.py file Note: Also be sure to create __init__.py files for your packages (In your question you named them init.py)....

I need to install pip on OSX. How can I do this?

python,pip,setuptools

It's pretty straightforward. The same you do on other operating systems sudo easy_install pip pip also comes with Homebrew's default python brew install python ...

With setuptools, when does namespace packages __init__.py files disappears?

python,setuptools,namespace-package

@Anzel's comment looked like a good answer, and I'd say PEP-420 confirms that. In its Rationale section, we read: Namespace packages are designed to support being split across multiple directories (and hence found via multiple sys.path entries). In this configuration, it doesn't matter if multiple portions all provide an __init__.py...

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

python-2.7,pip,homebrew,setuptools,python-3.4

Per the documentation: This module does not access the internet. All of the components needed to bootstrap pip are included as internal parts of the package. and (emphasis mine): To ensure the installed version of pip is at least as recent as the one bundled with ensurepip, pass the --upgrade...

Workflow when developing a packaged django application

python,django,setuptools

Use the -e flag to pip install to install the project in editable/develop mode. pip install -e path/to/my/source ...

Dependencies from git aren't being installed?

python,python-2.7,pip,setuptools,distutils

Looks like the issue was with: package_dir In my setuptool.setup function call. Removing that keyword argument completely resolved my issue. Additionally I put all my requirements in p0's "requirements.txt"....

Installing another source distribution in setup.py?

python,setuptools,setup.py

Setuptools documentation actually covers installation of dependencies that aren’t registered in PyPI. http://pythonhosted.org/setuptools/setuptools.html#dependencies-that-aren-t-in-pypi...

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

python,pip,setuptools,distutils

You can get away with this with just a setup.py and your module--no additional directories. In your setup.py just use setup(..., py_modules=['one_file'], ...) (you might want to check on the exact spelling). To install the script you can use the console_scripts entry-point: from setuptools import setup setup( name='one-file', version='1.0', py_modules=['one_file'],...

python implicit namespace packages are not installing with setuptools

python-3.x,namespaces,setuptools,python-3.4

It appears that the initial pull request that added PEP 420 support to setuptools was rejected. There is an open discussion on the best way to merge in PEP 420 support on another issue, but at the moment, it doesn't appear that implicit namespaces are supported.

setuptools: Run tests on build dir instead of original dir

python-3.x,setuptools,python-unittest,distribute,2to3

First of all, the line logger.info(u'Scanning {path}'.format(path=self.path)) is not valid in Python 3.2. The syntax for u'' isn't valid as the u was removed in Python 3.0 and reintroduced in Python 3.3, not 3.2. This means you should convert your tests to work in Python 3.2 without such Unicode string...

setup.py, pip - get origin path of execution of python package

python,pip,setuptools,setup.py

Instead of trying to coerce setuptools to do your bootstrapping, consider tools like cookiecutter which are designed to handle other bootstrapping and setup tasks for a variety of projects. There are templates available for django as well (see here for example)....

pip command is not being recognized

python,django,pip,setuptools

The path is set incorrectly so adding so add the following to .bashrc: export PATH=$HOME/opt/python3.4.2/bin:$PATH And then source ~/.bashrc. ...

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

python,setuptools

The correct way to do this is via setuptools. The delightful Click library has a great example. Rather than having a scripts directory, simply combine that information in the application itself somewhere, so confections.py should contain something like this: def crunchy_frog(): '''Only the freshest killed frogs... ''' # TODO: implement...

How do I use setuptools or distutils to distribute a script as opposed to a Python package?

python,setuptools,distutils

You should use setuptools entry points and pip install pkg will create a bin/ script for you. When you do a system-wide package installation the script will go to /usr/bin or /usr/local/bin. About entry points...

ImportError when using console_scripts in setuptools

python,setuptools

You have to install your python script, before you can call it via your defined entry point This is my dummy project: dnsrep/ ├── dnsrep.py └── setup.py This is how setup.py looks like: from setuptools import setup setup( name='dnsrep', version='0.1', description='Program that gives a reputation score to url\'s\n.', py_modules=['dnsrep'], entry_points...

Why is an egg-info file created when I'm using distutils?

python,setuptools,distutils,virtualenvwrapper

There was discussion about adding setuptools to the stdlib for Python 2.5, and then about adding only pkg_resource (one part of setuptools). Various reasons made that not happen. The core devs recognized that setuptools was an important third-party tool, and accepted a change to make projects installed with a pure-distutils...

ZipImportError while installing setuptools windows 7

python,windows,setuptools

Try the 3.0 version https://pypi.python.org/packages/source/s/setuptools/setuptools-3.0.zip. It worked on my Python v2.75 when I had the same problem.

Python project using protocol buffers, Deployment issues

python,installation,protocol-buffers,setuptools,software-distribution

Ok, I solved the issue without requiring the user to install a specific old version or compile the proto files on another platform than my dev machine. It's inspired by this setup.py script from protobuf itself. Firstly, protoc needs to be found, this can be done using # Find the...

pip install traceback error while installing packages in Python

python,windows,python-2.7,pip,setuptools

According to this bug, you likely have a bad version of requests installed. It sounds like you need to remove requests completely and any reference to it and reinstall it using something other than pip. Otherwise pip may reinstall the old version using its cache.

Python: pip can't find setup.py

python,pip,setuptools

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...

PYTHONPATH vs. sys.path (RELOADED)

python,setuptools

The better way of doing this now is to use pip install with the -e option. pip install -e . It uses a directory with the setup.py file. The "." indicates this directory. This works the same way as the setuptools develop method. I believe that the develop creates an...

Error in installing setuptools (unorderable types: str() < NoneType())

python,setuptools

I was able to solve my problem (on Win 8.1 64bit, Python 3.4.2) with the change suggested here: https://bitbucket.org/pypa/setuptools/pull-request/122/ensure-py_version-and-platform-are-str-in/diff#chg-pkg_resources/init.py...

Python custom module installalation won't copy static files

python-2.7,setuptools,python-module,pypi

I think I've got this. In your setup.py change include_data_package=True, into: include_package_data=True If you look at the log when doing python setup.py install, you'll find the clue: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'include_data_package' Besides, I also made some modifications to the MANIFEST.in, to make it clearer: include Makefile CHANGES LICENSE...

How to declare build-time dependencies without breaking other packages?

python,setuptools

(This behaviour is corrected in python-daemon version 2.0.4 and later.) There are two sides to this: Setuptools assumes it is the centre of everything. Version 2.0.3 of python-daemon doesn't take that into account. A more detailed explanation: There is some complex code using Docutils involved in the python-daemon build process,...

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

python,cmake,setuptools,distutils,setup.py

It took me a while to understand your question. If I understand correctly, what you are trying to do is provide the IodSymbolize.cmake in the standard installation location of cmake so that other users/projects who rely on your software(symbolizer) can use it in their build process. I think you are...

Store and retrieve metadata about Python distributions

python,setuptools

The most stable, reliable portion of setuptools appears to be entry_points. The solution I adopted involves using an additional entry point group to locate dictionaries, which plugin dists can bury at whatever Python path they like (including inside their package in the namespace packages). Then the system simply looks for...

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

python,setuptools

Requirement specifier section in pip docs links to the official docs for requirement specifiers implemented by setuptools pkg_resources. It specifies the formal syntax but says nothing on the semantics. Overview docs explain semantics but say nothing on the ~= and === stuff that were apparently added somewhere between vv.7 (installed...

What's a good pip/setuptools compliant version number for a fork of a package?

python,pip,setuptools

It seems that there's not an official convention for naming a fork for a python package. As @larsman pointed out in the question comments, a standard convention forking package-1.6.4 is package-1.6.4-forkname-0.1 -- and while this has been used by the Linux community (and others) for years, it has recently lost...

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

python,git,packages,setuptools

Note that the following setup: /dir1 __init__.py from module import abc module.py abc = None is externally (pretty much) indistinguishable from: /dir1 __init__.py from module import abc /module __init__.py from module1 import abc module1.py # this is the moved and renamed module.py, with git history abc = None module2.py #...

can't copy 'ANIFEST.in': doesn't exist or not a regular file

pip,setuptools,distutils

With a hint from this thread, I realized that I was making the mistake; I didn't really understand all the options to the setup function in setup.py. I had package_dir={'spherical_functions': ''}, when I should have had package_dir={'spherical_functions': '.'}, (Note the extra dot.) After including this, it seems to work just...

read README in setup.py

python,setuptools,distutils,setup.py

To manually include files in a distribution do the following: set include_package_data = True Create a MANIFEST.in file that has a list of include <glob> lines for each file you want to include from the project root. You can use recursive-include <dirname> <glob> to include from sub-directories of the project...

Allowing a python package requirement to fail in setup

python,pip,setuptools,setup.py

Optional dependencies specified by user at installation time: You can use the extras_require parameter to setup(): http://pythonhosted.org/setuptools/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies setup( name="MyProject", ... extras_require = { 'ProviderX': ["DependencyX1", "DependencyX2"], 'ProviderY': ["DependencyY"], } ) With this method, the user can ask to install specific extensions pip install Myproject[ProviderX]. Optional dependencies based on existing packages:...

setuptools finds wrong package during install

python,python-2.7,setuptools

(Mirrored from https://github.com/uwescience/myria-python/pull/35) Multiple hours of 100's of Google searches eventually took me to this numpy thread: https://github.com/numpy/numpy/issues/2434 for which they had to add numpy to setup_requires AND install_requires to fix a similar issue. Doing this with requests seems to have worked. However, I am somewhat skeptical as @Timusan indicated...

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

python,module,setuptools

You need some more __init__'s. The __init__.py file tells python that the folder is a python module. You are refrencing these as modules in your setup script, so you need to tell python that they are modules. knife/ knife/ bin/ knife-cli.py core/ main/ __init__.py __init__.py __init__.py setup.py That should fix...

Python & setuptools - 'No module named…'

python,setuptools

You have module jiragen.py named as parent package. This can be an issue if you use absolute imports.

Python packaging: catering to different audiences

python,packaging,setuptools,software-distribution

Here's what I did now. I browsed PyPI looking for similar packages, then took a look at wikidump's directory structure and its setup.py. There I found out about the entry_points parameter which allows one to specify module functions that will be converted to scripts at build time. These scripts may...

specify wheel cache when installing a package

python,setuptools,python-wheel

To disable the wheel cache you can simply do: sudo pip install . --no-cache-dir ...

Parse setup.py without setuptools

python,python-2.7,setuptools

You can dynamically create a setuptools module and capture the values passed to setup indeed: >>> import imp >>> module = """ ... def setup(*args, **kwargs): ... print(args, kwargs) ... """ >>> >>> setuptools = imp.new_module("setuptools") >>> exec module in setuptools.__dict__ >>> setuptools <module 'setuptools' (built-in)> >>> setuptools.setup(3) ((3,), {})...

error while accessing method of class - python package

python,python-2.7,setuptools

I've downloaded your file, and you have indentation issues. Because you're mixing tabs and spaces, Python is considering printList as nested inside __init__. Stick to spaces only....

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

python,python-3.x,setuptools,setup.py

setup.py is intended for people who are writing their own Python code and need to deploy it. If you either haven't written any Python code, or for some reason do not need to deploy any of the code you have written (you're not doing development in production, are you?), setup.py...

How can I use setuptools to generate a console_scripts entry point which calls `python -m mypackage`?

python,deployment,setuptools,pep

How can I use entry_points to generate a binary that calls python -m mypackage (and passes *args, **kwargs) ? I think this is the wrong way to look at the problem. You don't want your script to call python -m mypackage, but you want the script to have the...

how do i control to which python to install a package

python,setuptools,distutils,setup.py,mosek

I believe it is your setup.py options which are causing the error. Specifically the user option will install into a specific directory linked to your user profile https://docs.python.org/2/install/#alternate-installation-the-user-scheme , regardless of what's linked to the WinPython. This is for users who do not have write privileges in system directories. If...

Permission denied Setuptools

python,django,curl,setuptools

You need sudo for the python command to write to /Library/Frameworks...: curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python ...

pip 6.0.6 installs setuptools 0.6rc11 on CentOS 6.3 with Python 2.6.6 installed

python,centos,pip,chef,setuptools

Thanks to xavfernandez on github for providing the answer. The problem is that the version number of setuptools-0.6rc11 doesn't match the filename of the egg file. Either deleting the egg file for setuptools or renaming the egg file to match the version number will resolve the issue. If the version...

Making a neat, installable Python library with Click

python,click,command-line-interface,setuptools

If you've followed the Setuptools Integration steps in the article you linked to, you're most of the way there. Try installing the package as if it came from pip (maybe in a different virtualenv): $ virtualenv deploy $ source deploy/bin/activate $ pip install . Then you can invoke your command...

setuptools ez_setup return me UnicodeDecodeError

python-2.7,python-3.x,windows-xp,setuptools

I open my file with IDE and run it(because if you run code from cmd and you have both python2 and python3 it will run with python2 and iif you run it from IDE for python3 it will run in python3). I really don't know if my explanation is true(because...