setup.py

Python: migrate setup.py “scripts=” to entry_points

只谈情不闲聊 提交于 2019-12-04 01:49:35
I'd like to make use of someone else's python utility, foobartools , whose native environment is linux. Foobartools is pure python so there's no reason it can't be used on Windows, where I am. In their setup.py they're using the older style scripts=['bin/foobar'], . Running pip install -e b:\code\foobar creates a file called foobar in %pythonhome%\Scripts , but Windows doesn't know about it even though Scripts is in PATH. To use it I need to make a @python %pythonhome%\scripts\foobar batch file. This works but is non-optimal ( ctrl-c handling is ugly for instance). I know that if I add the

How to install MySQL-python on Amazon Web Services EC2 instance?

此生再无相见时 提交于 2019-12-03 17:17:00
I have a EC2 instance created on AWS and use PuTTY to connect to it. I'm unable to install MySQL-python using python pip command as follows: pip install MySQL-python (via root privileges) Here is the console output of the error Collecting MySQL-python Using cached MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: sh: mysql_config: command not found Traceback (most recent call last): File "<string>", line 20, in <module> File "/tmp/pip-build-JGbAEI/MySQL-python/setup.py", line 17, in <module> metadata, options = get_config() File "/tmp/pip-build-JGbAEI/MySQL-python

Why is dependency links in setup.py deprecated?

六眼飞鱼酱① 提交于 2019-12-03 15:13:14
There are quite a few people wondering for an alternative to dependency links in the setup.py (activated with the pip flag --process-dependency-links ): What is the alternative to using --process-dependency-links with pip , Depend on git repository in setup.py . Basically, I got bitten by the deprecation warning: "DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release." Some people have suggested using requirements.txt , however that is not an alternative as it is meant to provide an entire environment, usually more associated with development. The

Setup in virtualenv: `pip install -e .` vs `python setup.py install`

喜夏-厌秋 提交于 2019-12-03 13:05:46
I'm following a Flask tutorial that has me using virtualenv , and with it I built an app directory tree that looks like this: app/ |__app/ |__app.egg-inf/ |__setup.py |__venv/ Inside my venv the tutorial tells me to run pip install -e . which appears to be using my setup.py to install dependencies and my application. Why does the tutorial have me running pip install -e . ? Why not python setup.py install ? What are the differences? (FWIW, export FLASK_APP=app; flask run works fine after pip install -e . but doesn't work after a python setup.py install ) First, the commands you mention are not

how to set bug tracker url in setup.py script

时间秒杀一切 提交于 2019-12-03 10:55:16
问题 I have just discovered the pypi web UI have a field 'Bug tracker URL' in edit of egg metadata. This field exists so I guess it is supported in setup.py but I can't find anything about this using google. So the question how do I set up this field in my setup.py so when doing a dist release on pypi it can be automaticly filled. 回答1: The entry is called bugtrack_url , but it's not being picked up from setup.py . From context and code I understand it was intended to be used through-the-web on

How do I install Python packages in Google's Colab?

和自甴很熟 提交于 2019-12-03 09:20:23
In a project, I have e.g. two different packages, How can I use the setup.py to install these two packages in the Google's Colab, so that I can import the packages? You can use !setup.py install to do that. Colab is just like a Jupyter notebook. Therefore, we can use the ! operator here to install any package in Colab. What ! actually does is, it tells the notebook cell that this line is not a Python code, its a command line script . So, to run any command line script in Colab, just add a ! preceding the line. For example: !pip install tensorflow . This will treat that line (here pip install

Setting up setup.py for packaging of a single .py file and a single data file without needing to create any folders

假如想象 提交于 2019-12-03 07:27:47
问题 Project tree: $. ├── happy_birthday-art.txt ├── happy_birthday.py ├── MANIFEST.in ├── README.rst └── setup.py setup.py from setuptools import setup setup( name='Happy_birthday', py_modules=['happy_birthday'], data_files=['happy_birthday-art.txt'], entry_points={ 'console_scripts': ['happy_birthday = happy_birthday:main', ],}, long_description=open('README.rst').read(), ) Now when I do python setup.py sdist and then pip install the created .tar.gz file in a virtual environment I get the

Compiling & installing C executable using python's setuptools/setup.py?

非 Y 不嫁゛ 提交于 2019-12-03 06:11:59
I've got a python module that calls an external binary, built from C source. The source for that external executable is part of my python module, distributed as a .tar.gz file. Is there a way of unzipping, then compiling that external executable, and installing it using setuptools/setup.py? What I'd like to achieve is: installing that binary into virtual environments manage compilation/installation of the binary using setup.py install , setup.py build etc. making the binary part of my python module, so that it can be distributed as a wheel without external dependencies Solved in the end by

Using setup.py to install python project as a systemd service

这一生的挚爱 提交于 2019-12-03 05:33:55
问题 I have a python project and I want to be able to install it using something like python setup.py install so that the installation automatically creates a systemd service. I'm having some trouble, most probably setting the paths or imports correctly. My environment: Ubuntu 15.04 Python 2.7 (although it would be great to make it work in py3 too). Project Structure: + top-folder + super_project + folder1 __init__.py file1.py + folder2 __init__.py file2.py __init__.py main.py setup.py setup.cfg

python setup.py configuration to install files in custom directories

寵の児 提交于 2019-12-03 05:32:09
I want to create a setup.py which would install my files into custom directories. I have a certain prefix, where I would like to get the following result: /my/prefix/ bin/ script.sh libexec/ one.py two.py ... lib/pythonX.Y/site-packages/ package/... My initial project is following: / script.sh one.py two.py ... setup.py package/... __init__.py ... What would be the best way to achieve that? I would like to be able to install it later with something like: python setup.py install --prefix=/my/prefix I can get "package" nicely installed in the correct directory as lib/pythonX.Y/site-packages