You can setup two virtual environments and install the dependencies for each script separately. The documentation at http://pypi.python.org/pypi/virtualenv should be able to help with the installation.
On Tue, Dec 8, 2009 at 3:35 PM, <sqlalchemy@googlegroups.com> wrote: > Today's Topic Summary > > Group: http://groups.google.com/group/sqlalchemy/topics > > - How to import different version of > SQLachlemy?<#12570a5fc56ee21f_group_thread_0>[1 Update] > > Topic: How to import different version of > SQLachlemy?<http://groups.google.com/group/sqlalchemy/t/a73a23dbec1ddb82> > > Ning <station.n...@gmail.com> Dec 08 03:00PM -0800 > > Hello > > I am new to python. I have got two version of SQLAlchemy, 0.4.0 and > 5.5. > > Some of my old script built in 0.4.0, and I do not want to change the > script. > > Is that any way I can define in the script to use SQLAlchemy 0.3.11 > for my old script and 5.5 for my new script? > > I think you can use pkgresources to determine which version of > sqlalchemy to be imported. but it is not working, please see my code > below: > > In [23]: from pkg_resources import require > In [24]: require('sqlalchemy == 0.4.0') > Out[24]: [sqlalchemy 0.4.0 (c:\pythonxy\python26\lib\site-packages > \sqlalchemy-0.4.0-py2.6.egg)] > In [25]: import sqlalchemy > In [26]: sqlal > sqlalchemy sqlalchemy-0.4.0-py2.6.egg sqlalchemy-0.5.6-py2.6.egg > In [26]: sqlalchemy.__version__ > Out[26]: '0.4.0' > > That is file, but when i try to load version 5.6. It said got version > conflict > > In [28]: require('sqlalchemy == 0.5.6') > > --------------------------------------------------------------------------- > VersionConflict Traceback (most recent call last) > > C:\Pythonxy\Python26\Lib\site-packages\<ipython console> in <module>() > > C:\Pythonxy\Python26\Lib\site-packages\pkg_resources.pyc in require > (self, *requirements) > 624 """ > 625 > --> 626 needed = self.resolve(parse_requirements(requirements)) > 627 > 628 for dist in needed: > C:\Pythonxy\Python26\Lib\site-packages\pkg_resources.pyc in resolve > (self, requirements, env, install > er) > 526 if dist not in req: > 527 # Oops, the "best" so far conflicts with a dependency > --> 528 raise VersionConflict(dist,req) # XXX put more info here > 529 requirements.extend(dist.requires(req.extras)[::-1]) > 530 processed[req] = True > VersionConflict: (sqlalchemy 0.4.0 (c:\pythonxy\python26\lib\site- > packages\sqlalchemy-0.4.0-py2.6.egg), Requirement.parse > ('sqlalchemy==0.5.6')) > > any help will be more than welcome. :D > > Ning > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com<sqlalchemy%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.