5👍
There’s definitely something fishy going on if it can’t find module time
– as far as I’m aware that module is actually built in to the Python binary itself so it’s not as if there’s a time.py
or time.so
file which could have been deleted. It looks as if either Python in your virtualenv has become broken somehow, or there’s something about the environment that’s messing it up.
Setting a dubious PYTHONHOME
variable can cause Python all sorts of trouble as it can’t find necessary files, but I think in this case it’s the fact that the virtualenv has become broken. In fact, I just tried an old virtualenv on PythonAnywhere myself and got the same issue. It looks as if the symlinks that virtualenv creates have become broken as the result of an upgrade, possibly the recent upgrade from Debian to Ubuntu.
If at all possible I would simply re-create a new virtualenv and run things from there. In principle you could use pip
to write a requirements file so you can create a new virtualenv with exactly the same versions of the code, but the problem is that you can’t run pip
to create this file, QED. There’s probably a clever way to use the system Python to run pip
and get the dependencies from your virtualenv, but it’s going to be tricky – it’s not designed to work that way.
Alternatively you could contact the PA devs – I know that some users did have problems with their virtualenvs around the time of the upgrade and they may have cunning scripts which can fix the problem. Even if you just build a new virtualenv and use it, I would contact them and make sure they know about this issue so they’re aware of it for future upgrades.
2👍
I had this happen to me this afternoon. I upgraded from Mint 14
to Mint 15
, and it appears that the system python on the former is 2.7.3 and the latter uses 2.7.4. I fixed this by deleting my virtualenv (which used python 2.7.3) and then recreated it using python 2.7.4.
Check my quick screencast. In it, I show that:
- the python environment is broken
- recreating the python env makes it work
- [Django]-NoReverseMatch at /, u'opts|admin_urlname' is not a registered namespace Django 1.4.1
- [Django]-Permission classess decorator is ignored. "Authentication credentials were not provided" response
- [Django]-How to display a name instead of email address with django send_mail?
0👍
I get this error this day.Because i use virtualenv,and enter this,but ,my python script still contains this
#!/usr/bin/python2.6
delete this sentence will ok
- [Django]-Django.core.exceptions.ImproperlyConfigured: CreateView is missing a QuerySet
- [Django]-Tastypie – where to restrict fields that may be updated by PATCH?
- [Django]-Determining if I need quotes in HTML with django template
- [Django]-AttributeError: 'decimal.Decimal' object has no attribute 'decode'