Y
Y
Yeldos Adetbekov2016-11-27 11:09:21
Django
Yeldos Adetbekov, 2016-11-27 11:09:21

How to fix virtualenv?

Hello, the other day there was a crash in my Ubuntu 14.04, all because I tried to install Skype and "accidentally" deleted system files (dependencies). In general, the terminal stopped functioning and I decided to download Ubuntu 16.04. In general, everything was coolly installed, even the old files remained in their places (the background also loaded). That's just one thing, but all the system settings that I made through the terminal dropped. And now python does not work in virtualenv. I am using python3. I remember taking a steam bath with virtualenv due to the fact that he always put python2.7 in the environment. And I remember I did some manipulations with " alias python='SOMETHING SOMETHING' " and pip also the same way, and everything used to work like this:

  • When I wrote "python manage.py runserver" the system understood it as "python3 manage.py runserver"
  • When I wrote "pip install django" the system understood it as "pip3 install django"

And now I enter the virtual machine and run django, the bash writes to me:
<b>(tsl) [email protected]:~/PycharmProjects/tsl/tsl$ </b>python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named 'django'

<b>(tsl) [email protected]:~/PycharmProjects/tsl/tsl$ </b>pip freeze
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Аварийный останов (сделан дамп памяти)

What to do? Help me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
planc, 2016-11-27
@dosya97

#virtualenvwrapper
export WORKON_HOME="$HOME/Projects/Python/Virtenv"
export VIRTUALENV_PYTHON=/usr/bin/python3
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh

Z
zelsky, 2016-11-27
@zelsky

--python python3 when creating venv something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question