bin/zopepy
>>> import cx_Oracle

La buildout "virtualizza" anche lei.

Ora quello che fa la buildout è una tecnica chiama "sys.path mangling"
che è difficile da spiegare ma evidente se fai "less bin/zopepy".
Invece, l'installazione che fa easy_install (peggio ancora con pip) usa
i file .pth all'interno di site-packages (nel tuo venv,
lib/python2.x/site-packages/) che fanno in modo che gli statement di
import si becchino i moduli.

Nota importante: se avete un pacchetto nella buildout
mynamespace.mypackage, non fate _mai_, dal vostro venv, "pip install
mynamespace.myotherpackage" perché "oscurerà" tutti i pacchetti
mynamespace.* che si trovano nella buildout e non nel site-packages del
virtelenv, grazie a una tecnica particolare nella creazione dei
file .pth che usa pip (easy_install, invece, non ha il problema) che fa
si guadagnare qualche decimo di secondo sugli import ma ha i side
effect di cui sopra.

On Wed, 19 May 2010 10:54:06 +0200
Vito Falco <[email protected]> wrote:

> Hola,
> sto tentando di utilizzare il gocept.cxoracle e alla fine del mio
> comando buildout (con successo) ottengo la seguente scritta
> 
> Because this distribution was installed --multi-version, before you
> can
> 
> import modules from this package in an application, you will need to
> 
> 'import pkg_resources' and then use a 'require()' call similar to one
> of
> 
> these examples, in order to select the desired version:
> 
> 
> >     pkg_resources.require("cx-Oracle")  # latest installed version
> 
>     pkg_resources.require("cx-Oracle==5.0.3")  # this exact version
> 
>     pkg_resources.require("cx-Oracle>=5.0.3")  # this version or
> higher
> 
> 
> >
> > Note also that the installation directory must be on sys.path at
> > runtime for
> 
> this to work.  (e.g. by being the application's script directory, by
> being
> > on
> 
> PYTHONPATH, or by being added to sys.path by your code.)
> 
> 
> 
> Io utilizzo virtualenv sul mio MacOS X SL.
> Ma che vuol dire? Avrò problemi nell'utilizzo?
> Se vado nella console python e digito "import cx_Oracle" mi risponde
> come se non l'avesse caricato... :-/
> 
> Vito
> 
> 



-- 
Simone Deponti

Abstract Open Solutions [ http://www.abstract.it ]

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Plone-IT mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html

Rispondere a