简体   繁体   中英

Importing Python modules without installing - Sybase ASE

I need to use the Sybase Python module but our SA's won't install because it's not in the repo's. I've downloaded it and placed it on the box and would just like to 'import' or 'include' the module without installing it first. - Is this possible? From the looks of it (Sybase ASE) it needs some type of compilation before use. Is it possible for this type of work around?

如果您可以让Sybase使用虚拟环境(我对Sybase一无所知,抱歉),也许您可​​以使用virtualenv安装模块,这通常不需要root访问权限或SA批准。

From the sybase documentation it looks like compilation is required, and Google tells me that it's not available in the easy_install repos either.

It may be easier to do a little social engineering (cookies anyone?) to get the modules installed for you. I don't know what your work environment is like, but if you really need the python Sybase module to do your job, either 1) the SA's should be installing it anyway, or 2) you need to be using something different.

You could always try writing a python script that does the d/l and install automagically and give it to the SAs so they don't have to worry about the "difficulty" of doing something besides apt-getting.

I don't know about the virtual environments, though - that might be an ideal avenue.

Assuming you meet the prerequisites for compiling, untarring it and then running:

python setup.py build_ext

should produce a sybasect shared object. Copying this file and the Sybase.py file somwhere onto PYTHONPATH might just do it for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM