Question on virtualenv (python) and FreeBSD

Marcus von Appen mva at FreeBSD.org
Sat May 31 20:08:37 UTC 2014


On, Sat May 31, 2014, Alfred Perlstein wrote:

[...]
> Specifically it seems like FreeBSD is shipping a relatively stripped
> down version of Python that makes using virtualenv not work.

Please be precise here. It does not work for your specific use case.

> > ~/gitbridge/app % python db_repo/manage.py  version_control sqlite:///db.db  db_repo
> > Traceback (most recent call last):
> >   File "db_repo/manage.py", line 5, in <module>
> >   main(debug='False')
> >   File "/home/alfred/gitbridge/lib/python2.7/site-packages/migrate/versioning/shell.py", line 207, in main
> >   ret = command_func(**kwargs)
> >   File "<string>", line 2, in version_control
> >   File "/home/alfred/gitbridge/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 155, in with_engine
> >   engine = construct_engine(url, **kw)
> >   File "/home/alfred/gitbridge/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 140, in construct_engine
> >   return create_engine(engine, **kwargs)
> >   File "/home/alfred/gitbridge/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 344, in create_engine
> >   return strategy.create(*args, **kwargs)
> >   File "/home/alfred/gitbridge/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 73, in create
> >   dbapi =dialect_cls.dbapi(**dbapi_args)
> >   File "/home/alfred/gitbridge/lib/python2.7/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 297, in dbapi
> >   raise e
> > ImportError: No module named pysqlite2
> >
>
> I have details and a workaround on my blog here (less messy than pasting
> the entire 200+ lines of info into this message):
> http://splbio.wordpress.com/2014/04/19/using-djangosqlalchemy-and-virtualenv-on-freebsd/
>
> Basically it seems that because we don't by default ship sqlite with
> Python we wind up with this odd situation where the virtualenv'd Python
> can't be used for the apps that I tend to use.
>
> I'm wondering can something be done to make virtualenv work better out
> of the box for people?

Shouldn't that be rephrased to "make virtualenv work better out of the box
with my applications requiring package X?"

Sorry for nit-picking here. We strip certain parts of a Python default
installation, which others might or might not do. One could create a FAQ, what
to watch or which additional packages are recommended for installation. Right
now, I do not see a huge issue here, though.

If this is a problem that someone sees as more critical for users, we should
rethink the customized Python installation process, which however also means
that users would have to install more dependencies, when they just want a
simple Python interpreter.

Cheers
Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-python/attachments/20140531/f18f9c1b/attachment.sig>


More information about the freebsd-python mailing list