timothycrosley / deprecated.pies

The simplest (and tastiest) way to write one program that runs on both Python 2 and Python 3.
MIT License
148 stars 7 forks source link

Python 3 virtualenv creation error due to bundled configparser.py #11

Closed justinmayer closed 10 years ago

justinmayer commented 10 years ago

I installed isort, which in turn installed pies and pies2overrides, the latter of which appears to bundle its own configparser.py module. Looking at the error output below, the presence of the bundled configparser.py module seems to cause an error when I try to create Python 3 virtual environments (using Mac OS X 10.9.1 with Homebrew-installed Python 2.7.6 [primary] and Python 3.3.3.)

Both pip and virtualenv are located in: /usr/local/lib/python2.7/site-packages/

Uninstalling isort and its dependencies resolved the problem, which is sad because isort is immensely useful.

Any suggestions as to how this issue might be resolved?

Steps to reproduce:

> pip install isort
> virtualenv -p python3 testenv

Running virtualenv with interpreter /usr/local/bin/python3
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 41, in <module>
    import ConfigParser
ImportError: No module named 'ConfigParser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 43, in <module>
    import configparser as ConfigParser
  File "/usr/local/lib/python2.7/site-packages/configparser.py", line 3, in <module>
    from ConfigParser import *
ImportError: No module named 'ConfigParser'
timothycrosley commented 10 years ago

Hi @justinmayer ,

I haven't been able to reproduce this locally, however, it seems like the easiest solution would be to install the Python3 version of isort - as this doesn't include pies2overrides:

timothy@timothy-desktop:~$ sudo pip3 install isort Downloading/unpacking isort ... Successfully installed isort pies natsort enum34 Cleaning up... timothy@timothy-desktop:~$ pip3 freeze apparmor==2.8.0 apturl==0.5.2ubuntu2 chardet==2.0.1 command-not-found==0.3 decorator==3.4.0 defer==1.0.6 distribute==0.6.37 enum34==0.9.19 ipython==0.13.2 isort==3.1.0 language-selector==0.1 lxml==3.2.0 natsort==3.0.2 pies==2.5.1 pygobject==3.10.0 python-apt==0.8.9.1ubuntu1 python-debian==0.1.21-nmu2ubuntu1 screen-resolution-extra==0.0.0 simplegeneric==0.8.1 six==1.3.0 ubuntu-drivers-common==0.0.0 ufw==0.33-0ubuntu4 unattended-upgrades==0.1 usb-creator==0.2.23 xkit==0.0.0

Let me know if you have any issues, or need any more help :)

Thanks!

~Tim