Ilya Bibik
Ilya Bibik

Reputation: 4114

After pip upgrade error cant import django any more - No module named Utils.version

after running pip install django-csvimport -U

tried to uninstall my django rolled back and got error WindowsError:

[Error 5] Access is denied:

After this when I import django I get error -

ImportError: No module named Utils.version

What is wrong?How can I fix it? Django is installed and I have added to python path django folder I am getting from the pip.

>  (rent_unit_venv) C:\Users\PAPA\DEV\rent_unit\src>pip install
> django-csvimport -U
>     Collecting django-csvimport
>       Downloading django-csvimport-2.11.tar.gz (45kB)
>         100% |################################| 51kB 188kB/s
>     Collecting django>=1.7 (from django-csvimport)
>       Downloading Django-1.11.4-py2.py3-none-any.whl (6.9MB)
>         100% |################################| 7.0MB 116kB/s
>     Collecting chardet (from django-csvimport)
>       Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
>         100% |################################| 143kB 1.9MB/s
>     Collecting pytz (from django>=1.7->django-csvimport)
>       Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
>         100% |################################| 491kB 1.0MB/s
>     Building wheels for collected packages: django-csvimport
>       Running setup.py bdist_wheel for django-csvimport ... done
>       Stored in directory: C:\Users\PAPA\AppData\Local\pip\Cache\wheels\29\69\de\206e3a0263d286c9300dcc833b60ba95a75919c4bb00ca78b2
>     Successfully built django-csvimport
>     Installing collected packages: pytz, django, chardet, django-csvimport
>       Found existing installation: Django 1.8
>         Uninstalling Django-1.8:
>           Successfully uninstalled Django-1.8
>       Rolling back uninstall of Django
>     Exception:
>     Traceback (most recent call last):
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\site-packages\pip\basecommand.py",
> line 215, in main
>         status = self.run(options, args)
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\site-packages\pip\commands\install.py",
> line 342, in run
>         prefix=options.prefix_path,
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\site-packages\pip\req\req_set.py",
> line 790, in install
>         requirement.rollback_uninstall()
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\site-packages\pip\req\req_install.py",
> line 759, in rollback_uninstall
>         self.uninstalled.rollback()
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\site-packages\pip\req\req_uninstall.py",
> line 135, in rollback
>         renames(tmp_path, path)
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\site-packages\pip\utils\__init__.py",
> line 265, in renames
>         os.makedirs(head)
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\os.py", line 150, in makedirs
>         makedirs(head, mode)
>       File "c:\users\papa\dev\rent_unit\rent_unit_venv\lib\os.py", line 157, in makedirs
>         mkdir(name, mode)
>     WindowsError: [Error 5] Access is denied: 'c:\\users\\papa\\dev\\rent_unit\\rent_unit_venv\\lib\\site-packages\\django\\contrib\\admin\\templates'

Upvotes: 0

Views: 176

Answers (1)

Ed Crewe
Ed Crewe

Reputation: 46

I believe this can be a common problem for version 1.8 upgrading. Seen various reports for other third party django packages. Certainly if your previous Django was 1.6 or earlier then it would of only worked with old csvimport 2.1, and requires an upgrade to version 2.11

You should be able to use current csvimport 2.11 with django 1.8 but I would recommend you use latest django 1.11

You may need to pip uninstall django-csvimport then upgrade django then re-install latest csvimport.

Ed Crewe

Upvotes: 1

Related Questions