egg

How to access files inside a Python egg file?

百般思念 提交于 2019-11-29 09:10:01
This might be a weird requirement but it's what I've run into. I Googled but yield nothing. I'm coding an application who's using a lot of constant attributes / values recorded in an XML file (they'll not change so a static file), things work fine until I generated an egg file for it. When the logic reaches the XML accessing part, I got one complaint like this: /home/Workspace/my_proj/dist/mps-1.2.0_M2-py2.6.egg/mps/par/client/syntax/syntax.xml Actually I've bundled the XML file in the path above but seems Python doesn't know how to access it. The code to access the XML is as... file_handler =

Most Pythonic way to provide global configuration variables in config.py?

孤街浪徒 提交于 2019-11-28 16:17:32
In my endless quest in over-complicating simple stuff, I am researching the most 'Pythonic' way to provide global configuration variables inside the typical ' config.py ' found in Python egg packages. The traditional way (aah, good ol' #define !) is as follows: MYSQL_PORT = 3306 MYSQL_DATABASE = 'mydb' MYSQL_DATABASE_TABLES = ['tb_users', 'tb_groups'] Therefore global variables are imported in one of the following ways: from config import * dbname = MYSQL_DATABASE for table in MYSQL_DATABASE_TABLES: print table or: import config dbname = config.MYSQL_DATABASE assert(isinstance(config.MYSQL

Python packages and egg-info directories

被刻印的时光 ゝ 提交于 2019-11-28 15:54:45
问题 Can someone explain how egg-info directories are tied to their respective modules? For example, I have the following: /usr/local/lib/python2.5/site-packages/quodlibet/ /usr/local/lib/python2.5/site-packages/quodlibet-2.0.egg-info/ I'm assuming the egg-info directory is to make the corresponding module visible to setuptools (easy_install), right? If so, how does setuptools tie the egg-info directory to the module directory? Assuming that I'm on the right track, and for the sake of example...

Build a wheel/egg and all dependencies for a python project

≯℡__Kan透↙ 提交于 2019-11-28 15:53:56
In order to stage python project within our corporation I need to make an installable distribution. This should include: An egg or whl for my project An egg or whl for every dependency of the project (optionally) produce a requirements.txt file listing all the installable components for this release Is there an easy plug in, (e.g. an alternative to bdist_wheel) that will not only compile one wheel but also that project's components? Obviously I can script this, but I was hoping that there might be a short-cut that builds the package + dependencies in fewer steps. This needs to work on Python 2

Where can I download binary eggs with psycopg2 for Windows?

寵の児 提交于 2019-11-28 07:27:58
I'm looking for binary eggs with psycopg2's binaries for Windows but can't find any. On http://initd.org/psycopg/download/ there's only source package and link to Windows port of Psycopg which provides binary installers but no binary eggs. The reason I'm looking for binary egg is I'd like to install psycopg in virtualenv and it's not ( this answer describes why it usually is possible) possible with standard Windows installers which look for installed Python in the registry. Side note: I guess psycopg is rather popular library and it strikes me as odd not to provide binary eggs for download on

How to access files inside a Python egg file?

守給你的承諾、 提交于 2019-11-28 02:33:41
问题 This might be a weird requirement but it's what I've run into. I Googled but yield nothing. I'm coding an application who's using a lot of constant attributes / values recorded in an XML file (they'll not change so a static file), things work fine until I generated an egg file for it. When the logic reaches the XML accessing part, I got one complaint like this: /home/Workspace/my_proj/dist/mps-1.2.0_M2-py2.6.egg/mps/par/client/syntax/syntax.xml Actually I've bundled the XML file in the path

Unable to install pip: Permission denied error

左心房为你撑大大i 提交于 2019-11-27 20:55:07
I am trying to install pip but currently unable to. I navigate to the pip folder and python setup.py install Everything seems to go fine until the very end: Extracting pip-0.8.2-py2.6.egg to /Library/Python/2.6/site-packages Adding pip 0.8.2 to easy-install.pth file Installing pip script to /usr/local/bin error: /usr/local/bin/pip: Permission denied I've also tried easy_install . and attempted to refer to the related thread with no luck: Python install uninstall easy_install Any ideas? Looks like you're on an Linux/Unix box and you're not root ... which means you don't have permission to put

Bundle python script and dependencies into a single file

耗尽温柔 提交于 2019-11-27 15:14:13
I have a few script that had their own copy of a some functions, so I extracted these functions to a module and had the scripts import the function. These script are to be copied over to a bunch of linux servers and executed. When the scripts worked standalone, I would simply copy the files over to the servers and execute "python ". I have a central management server that will copy and run the scripts on the different servers. I've done some reading on python eggs, but could use some advice on method to go for. The way I do it today is to copy and simply run the python script. As this works

Is there a python equivalent of Ruby's 'rvm'?

巧了我就是萌 提交于 2019-11-27 10:02:39
Q: Do we have anything functionally equivalent in Python to the Ruby version manager 'rvm' ? ( RVM lets you easily switch completely between different versions of the ruby interpreter and different sets of gems (modules). Everything concerning download-build-install-switch of interpreter(-s) and gems gets taken care of by invoking rvm. It is all run under your regular user account.) Yes, it is virtualenv along with virtualenvwrapper . update: you may install both at once with virtualenv burrito . Update : the correct answer is now probably pyenv . For scientific computing, the corresponding

Build a wheel/egg and all dependencies for a python project

我的梦境 提交于 2019-11-27 09:32:37
问题 In order to stage python project within our corporation I need to make an installable distribution. This should include: An egg or whl for my project An egg or whl for every dependency of the project (optionally) produce a requirements.txt file listing all the installable components for this release Is there an easy plug in, (e.g. an alternative to bdist_wheel) that will not only compile one wheel but also that project's components? Obviously I can script this, but I was hoping that there