pypi

A simple Hello World setuptools package and installing it with pip

核能气质少年 提交于 2019-12-31 10:40:49
问题 I'm having trouble figuring out how to install my package using setuptools, and I've tried reading the documentation on it and SO posts, but I can't get it to work properly. I'm trying to get a simple helloworld application to work. This is how far I got: helloworld.py: print("Hello, World!") README.txt: Hello, World! readme MANIFEST.in: recursive-include images *.gif setup.py: from setuptools import setup, find_packages setup( name='helloworld', version='0.1', license='BSD', author='gyeh',

Python console_scripts doesn't work when pip install --user

北城余情 提交于 2019-12-31 05:29:27
问题 I wrapped my code into python package and now I want it to be also runnable from the command line (linux). So I added console_scripts tag to setup.py and all seems to be working fine when I pip install it as a root. (I can run program from the command line) However I'd also like for a package to be installed by using pip install --user . so it can be installed on computers when root is not available to the user. However when I try to invoke program from the command line i got 'command not

Total Downloads of Module Missing on PyPi

荒凉一梦 提交于 2019-12-30 06:39:15
问题 Up until recently, it was possible to see how many times a python module indexed on https://pypi.python.org/pypi had been downloaded (each module listed downloads for the past 24hrs, week and month). Now that information seems to be missing. Download numbers are very helpful information when evaluating whether to build code off of one module or another. They also seem to be referenced by sites such as https://img.shields.io/ Does anyone know what happened? And/or, where I can view/retrieve

Python中的Modules和pip

◇◆丶佛笑我妖孽 提交于 2019-12-27 19:02:18
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Modules 对module的理解 和Java中一个类就是一个文件不同(当然不考虑内部类),python中一个.py文件可以包含多个class。Modules的目的是代码的划分、管理以及代码重用。一个module是一个包含了定义和代码的文件,个人认为module包含了针对功能的相关代码,在一个module中可以存在多个类、函数甚至是需要预执行的脚本。 compile&cache 为了加快加载速度python会缓存.py文件,在__pycache__指定的目录中缓存文件按照“ module. version .pyc”的名称保存 ,其中version部分是python的版本信息,这样使得不同版本的缓存可以共存。在引入module时python会检查是否存在缓存和缓存版本是否过期。但是以下两种情况,python不会加载缓存文件: command line中执行python时每次都会重新编译,不会尝试加载。 不存在源文件时,python不会直接从缓存中加载*.pyc文件。 python是脚本语言但是存在一个“编译”的概念,其实python的编译时去除了代码中非必须的部分——assert和__doc__部分。“编译”并不是回想Java那样进行代码优化,“编译”的目的在于加快module加载的速度。编译时使用参数

Failed to upload packages to PyPI: 410 Gone

对着背影说爱祢 提交于 2019-12-27 11:43:25
问题 After pypi.python.org has been migrated to pypi.org, I got an error when trying to upload a package to PyPI using the command as usual: python2.7 setup.py sdist upload The error message is: Upload failed (410): Gone (This API has been deprecated and removed from legacy PyPI in favor of using the APIs available in the new PyPI.org implementation of PyPI (located at https://pypi.org/). For more information about migrating your use of this API to PyPI.org, please see https://packaging.python.org

Installing from custom index setup.py

若如初见. 提交于 2019-12-24 11:34:24
问题 I am the package maintainer of a package that has dependencies to packages hosted in our own pip repository. I want these packages to also be installed when doing pip install mypackage . setup( name='mypackage', version='1.1.2', description='My awesome package', dependency_links=[ 'http://www.myrepo.se/packages/mydep1/', 'http://www.myrepo.se/packages/mydep2/' ] install_requires=[ 'mydep1==1.0.0', 'mydep2==5.6.7' ] ) The folder structure in the repo is the following: packages/ mydep1/ mydep1

Add kerberos from pypi to Anaconda under Windows

限于喜欢 提交于 2019-12-24 10:50:13
问题 Complete noob so would appreciate a step-by-step solution. I would like to add kerberos package to Anaconda but don't know how to do it. I have tried the using conda command line: pip install kerberos but it failed. Does anyone know how to go about it? This is the error log from pip: C:\Users\woodas\AppData\Local\Continuum\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -IC:\Users\woodas\AppData\Local\Continuum\Anaconda\include -IC:\Users\woodas\AppData\Local\Continuum\Anaconda\PC -c src

Python pandas: Create a new column with values in English by converting values stored in a different column in Chinese traditional

送分小仙女□ 提交于 2019-12-24 04:17:07
问题 I have a column "City_trad_chinese" in a pandas dataframe "df" which contains values in Traditional Chinese language. I need to create another column "City_English" which must contain the translated values in English. How can I do this with Python? I tried the following: #importing required libraries import pandas as pd from os import path from googletrans import Translator #setting path to data path2data = 'C:/Users/data' # data import df = pd.read_excel(path.join(path2data, 'data.xlsx'),

can't install or-tools on mac 10.10

走远了吗. 提交于 2019-12-24 01:53:35
问题 I'm trying to install Google's or-tools on mac 10.10 - https://code.google.com/p/or-tools/wiki/OrToolsWithPyPi . I install using python2.7 setup.py install --user (tried also with sudo and without --user) but get the following when it goes to pypi to download the package: .. Some other output .. Installed /Users/Zach/Library/Python/2.7/lib/python/site-packages/ortools_examples-1.3549-py2.7.egg Processing dependencies for ortools-examples==1.3549 Searching for ortools Reading https://pypi

Creating PyPi package - Could not find a version that satisfies the requirement iso8601

谁都会走 提交于 2019-12-23 12:42:49
问题 I'm creating a PyPi package with pip and trying to test that it works on the test environment (https://testpypi.python.org/pypi). Right now I have a package that appears to exist on the prod PyPi install but not on test. If I install the dependency with prod PyPi (ie. pip install iso8601==0.1.4) it works properly but if I install from the test PyPi (ie. pip install iso8601==0.1.4 -i https://testpypi.python.org/pypi) I get Could not find a version that satisfies the requirement iso8601==0.1.4