50
votes

I changed from Win XP 32bit to Win7 64bit and reinstalled Python 2.7 and the Anaconda package.

However, it seems like it isn't properly installed. When I do

import enum 

There is the error:

ImportError: No module named enum

However, when I try import pandas it works.

When typing help() and modules within Ipython nothing happens.

Any idea how to go from here?

6
when you said you reinstalled Python, is it an uninstall and then reinstall or is it an overwrite on what you had already? Also, did you reinstall using 64-bit Python or 32-bit? Chances are that you might have messed up your library settings. You should do fully clean uninstall, delete all temporary directories (if any), and then reinstall Python 2.7 (64-bit) to see if things look different. - ha9u63ar
I had winXp on my machine and python installed in the program folder. I added another partition and installed Win7 64bit on it. On this partition I installed Python without uninstalling it at the WinXP partition. Can this yield to messed up libraries? Should I uninstall Python on both partitions before reinstalling on Win7? Where to look for temporary directories that should be deleted? - user3276418
Try import sys, then print(sys.path) to see where your python libraries are read from. Maybe you'll find the problem this way... - jkalden
Everything points to C:\\Program Files\\Anaconda, which is the WIn7 partition. There is another path: 'C:\\Users\\hotz\\.ipython' that also points to the Win7 partition. Another path points to the directory where my personal scripts are stored. Everything here looks normal to me. - user3276418

6 Answers

70
votes

Or run a pip install --upgrade pip enum34

41
votes

I ran into this same issue trying to install the dbf package in Python 2.7. The problem is that the enum package wasn't added to Python until version 3.4.

It has been backported to versions 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4, you just need the package from here: https://pypi.python.org/pypi/enum34#downloads

4
votes

I ran into this issue with Python 3.6 and Python 3.7. The top answer (running pip install --upgrade pip enum34) did not solve the problem.


I don't know why, but the reason why this error happen is because enum.py was missing from .venv/myvenv/lib/python3.7/.

But the file was in /usr/lib/python3.7/.

Following this answer, I just created the symbolic link by myself :

ln -s /usr/lib/python3.7/enum.py .venv/myvenv/lib/python3.7/enum.py
1
votes

Please use --user at end of this, it is working fine for me.

pip install enum34 --user
0
votes

soved renaming file from 'enum.py(same name of import)' to 'myEnum(or anything else)'

-9
votes

Depending on your rights, you need sudo at beginning.