pypi

Prepare C-based Cython package to publish on pypi

☆樱花仙子☆ 提交于 2019-12-23 12:29:31
问题 I'm going to create C library and I would like to create Python wrapper using Cython. Right now I have mylib.a file compiled and bundled (C files) and I want to wrap methods from my library in Cython. I successfully created .pyx and .pxd files and I can build it using python setup.py build_ext command. My problem appears when I try publish it on pypi. If I run my setup.py , create wheel and publish it I can download it from pypi - but I can't run import mylib . I read a lot online tutorials

How to have PyPI package install header files for C extension with distutils/setuptools?

心已入冬 提交于 2019-12-22 09:20:12
问题 We have a package (rebound) up on PyPI that includes a C extension . The relevant part of the setup.py file looks like this (simplified): libreboundmodule = Extension('librebound', sources = [ 'src/rebound.c'], include_dirs = ['src'],) Additional libraries need access to rebound.h, but when one runs pip install rebound it doesn't install rebound.h anywhere. How can we get distutils/setuptools to install rebound.h somewhere along with all the python modules? We're hoping that we can have pip

Install python package from private pypiserver

本小妞迷上赌 提交于 2019-12-22 06:20:21
问题 I have setup a pypiserver behind an nginx proxy which uses htpasswd for authentication. I am currently able to upload sdists, but I can't figure out how to download them. I want to be able to download them when running setup.py test and somehow by using pip . Is this possible? [distutils] index-servers = private [private] repository = https://example.com/pypi username = remco password = mypass To make it extra hard the server is currently using a non verified ssl connection. I tried the

Image in README.rst not displaying in pypi

自古美人都是妖i 提交于 2019-12-22 04:10:13
问题 I would like an image linked in my README.rst file to be displayed when I upload my package to PyPI. In my README I have: .. image:: example-python.png :height: 100px :width: 200px :scale: 100 % :align: center and in MANIFEST.in I have: # Include the image file include example-python.png Right now it's not displaying in testpypi. It shows up just fine on GitHub, however. Am I doing something wrong? 回答1: In .. image:: example-python.png you use relative URL, i.e. a browser expects the image in

pip, proxy authentication and “Not supported proxy scheme”

廉价感情. 提交于 2019-12-22 04:05:27
问题 Trying to install pip on a new python installation. I am stuck with proxy errors. Looks like a bug in get-pip or urllib3 ?? Question is do I have to go through the pain of setting up CNTLM as described here or is there a shortcut? get-pip.py documentation says use --proxy="[user:passwd@]proxy.server:port" option to specify proxy and relevant authentication. But seems like pip passes on the whole thing as it is to urllib3 which interprets "myusr" as the url scheme, because of the ':' I guess (

Why is PyPi called the cheese shop?

北城余情 提交于 2019-12-22 01:46:53
问题 I was running through the tutorials to build a Python distro package yesterday and the PyPi site kept on being calling the Cheese Shop. Why is that? 回答1: Following the fact that the name of the Python language is taken from the Monty Python comedy group, it's a reference to the "Cheese Shop" sketch they did. There have been other prominent Python projects that have used the same approach to select names (Bicycle Repairman and Grail are the first that come to mind) 回答2: Because it's where you

Use setuptools to install from location

会有一股神秘感。 提交于 2019-12-20 03:49:37
问题 I have a framework for a site that I want to use in multiple projects but I don't want to submit my framework to PyPi. Is there anyway I can tell my setup.py to install the framework from a specific location? Here is my current setup.py from setuptools import setup setup( name='Website', version='0.2.1', install_requires=[ 'boto>=2.6', 'fabric>=1.4', 'lepl>=5.1', 'pygeoip>=0.2.4', 'pylibmc>=1.2.3', 'pymongo>=2.2', 'pyyaml>=3.1', 'requests>=0.12', 'slimit>=0.7.4', 'thrift>=0.8.0', 'tornado>=2

What is 'extra' in pypi dependency?

大憨熊 提交于 2019-12-19 21:41:28
问题 In requires_dist section of a package's json response from pypi, it is given: requires_dist : [ "bcrypt; extra == 'bcrypt'", "argon2-cffi (>=16.1.0); extra == 'argon2'" ] can anyone make it clear the second statement of each dependency, extra == 'bcrypt' and extra == 'argon2' ? 回答1: Extras are dependencies you can install in addition to the regular dependencies, if you ask for them explicitly. See them as optional features. You can install these with the name after the == , with the name of

'pip setup.py bdist_wheel' no longer builds forced non-pure wheels

谁说我不能喝 提交于 2019-12-19 06:28:09
问题 I have a project that compiles with C extensions on Linux, but without them on Windows. When I first generated the wheel files on Windows with python setup.py bdist_wheel , they became universal, and I could not upload them to PyPI as these universal wheels are preferred by pip for installation over the .tar.gz uploads (the result from python setup.py sdist ). The trick around this was to specify in the setup.py : Distribution.is_pure = lambda *args: False or by subclassing Distribution :

conda error: could not found url

≯℡__Kan透↙ 提交于 2019-12-19 03:21:27
问题 recently i installed the anaconda but when i'm open it i got this error: Error fetching package index Could not find URL: https://pypi.python.org/pypi/osx-64/ also when i'm using the command conda install ... i got Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: .....Error: Could not find URL: https://pypi.python.org/pypi/osx-64/ . and i cant install packages. and this is conda info : platform : osx-64 conda version : 3.19.1 conda-build version : 1.19.0