Install Djangorestfamework

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

crawler@linux:~/PycharmProjects/account_service$ conda -V

conda 4.3.14
crawler@linux:~/PycharmProjects/account_service$ conda update conda
Fetching package metadata .........
Solving package specifications: .

Package plan for installation in environment /home/crawler/anaconda2:

The following packages will be UPDATED:

conda: 4.3.14-py27_0 --> 4.3.30-py27h6ae6dc7_0

Proceed ([y]/n)? y

conda-4.3.30-p 100% |################################| Time: 0:00:00 2.28 MB/s


crawler@linux:~/PycharmProjects/account_service$ conda create -n account_service
python=3.6 anaconda
#
# To activate this environment, use:
# > source activate account_service
#
# To deactivate an active environment, use:
# > source deactivate
#

crawler@linux:~/PycharmProjects/account_service$ source activate account_service


(account_service) crawler@linux:~/PycharmProjects/account_service$ conda env list
# conda environments:
#
account_service * /home/crawler/anaconda2/envs/account_service
brat /home/crawler/anaconda2/envs/brat
root /home/crawler/anaconda2

(account_service) crawler@linux:~/PycharmProjects/account_service$ ls
account_service venv
(account_service) crawler@linux:~/PycharmProjects/account_service$ cd
account_service
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
ls
account_service db.sqlite3 manage.py
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
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
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
pip freeze > requirement.txt
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
conda env export > environment.yml
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
conda env create -f environment.yml
Using Anaconda API: https://api.anaconda.org
CondaValueError: prefix already exists:
/home/crawler/anaconda2/envs/account_service

(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
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
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):


File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on
your PYTHONPATH environment variable? Did you forget to activate a virtual
environment?
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
django-admin startproject
The program 'django-admin' is currently not installed. You can install it by
typing:
sudo apt install python-django-common
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
sudo apt install python-django-common
[sudo] password for crawler:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.12.0-11 linux-headers-4.12.0-11-generic linux-image-4.12.0-11-
generic linux-image-extra-4.12.0-11-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
python-django-common
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1.530 kB of archives.
After this operation, 16,6 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu artful/main amd64 python-django-common
all 1:1.11.4-1ubuntu1 [1.530 kB]
Fetched 1.530 kB in 3s (401 kB/s)
Selecting previously unselected package python-django-common.
(Reading database ... 333685 files and directories currently installed.)
Preparing to unpack .../python-django-common_1%3a1.11.4-1ubuntu1_all.deb ...
Unpacking python-django-common (1:1.11.4-1ubuntu1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up python-django-common (1:1.11.4-1ubuntu1) ...
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
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
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):


File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on
your PYTHONPATH environment variable? Did you forget to activate a virtual
environment?
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
activate account_service
Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'.

(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
source activate account_service
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
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
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):


File "manage.py", line 14, in <module>
) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on
your PYTHONPATH environment variable? Did you forget to activate a virtual
environment?
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
conda create --name account_service
sh: 0: getcwd() failed: No such file or directory
Traceback (most recent call last):
File "/home/crawler/anaconda2/envs/account_service/bin/conda", line 11, in
<module>
sys.exit(main())
File "/home/crawler/anaconda2/lib/python2.7/site-packages/conda/cli/main.py",
line 182, in main
return conda_exception_handler(_main, *args)
File "/home/crawler/anaconda2/lib/python2.7/site-packages/conda/exceptions.py",
line 644, in conda_exception_handler
return handle_exception(e)
File "/home/crawler/anaconda2/lib/python2.7/site-packages/conda/exceptions.py",
line 634, in handle_exception
print_unexpected_error_message(e)
File "/home/crawler/anaconda2/lib/python2.7/site-packages/conda/exceptions.py",
line 579, in print_unexpected_error_message
from .base.context import context
File "/home/crawler/anaconda2/lib/python2.7/site-packages/conda/base/context.py",
line 771, in <module>
context = Context(SEARCH_PATH, APP_NAME, None)
File "/home/crawler/anaconda2/lib/python2.7/site-
packages/conda/common/configuration.py", line 727, in __init__
self._set_search_path(search_path)
File "/home/crawler/anaconda2/lib/python2.7/site-
packages/conda/common/configuration.py", line 745, in _set_search_path
self._set_raw_data(load_file_configs(search_path))
File "/home/crawler/anaconda2/lib/python2.7/site-
packages/conda/common/configuration.py", line 364, in load_file_configs
expanded_paths = tuple(expand(path) for path in search_path)
File "/home/crawler/anaconda2/lib/python2.7/site-
packages/conda/common/configuration.py", line 364, in <genexpr>
expanded_paths = tuple(expand(path) for path in search_path)
File "/home/crawler/anaconda2/lib/python2.7/site-packages/conda/common/path.py",
line 247, in expand
return abspath(expanduser(expandvars(path)))
File "/home/crawler/anaconda2/lib/python2.7/posixpath.py", line 362, in abspath
cwd = os.getcwdu()
OSError: [Errno 2] No such file or directory
(account_service) crawler@linux:~/PycharmProjects/account_service/account_service$
cd ..
cd: error retrieving current directory: getcwd: cannot access parent directories:
No such file or directory
(account_service)
crawler@linux:~/PycharmProjects/account_service/account_service/..$ cd ..
(account_service) crawler@linux:~/PycharmProjects$ ls
account_service crawler fbcrawler-django-service internet_scrapy1.zip
Test
brat facenet-master html internet_scrapy.zip
untitled
brat.tar.gz fbcrawler internet_scrapy pypgadmin
untitled1
(account_service) crawler@linux:~/PycharmProjects$ conda create --name
account_service

CondaValueError: prefix already exists:


/home/crawler/anaconda2/envs/account_service

(account_service) crawler@linux:~/PycharmProjects$ conda create -n account_service


python=3.6

CondaValueError: prefix already exists:


/home/crawler/anaconda2/envs/account_service

(account_service) crawler@linux:~/PycharmProjects$ conda env create -f


enviroment.yml
Using Anaconda API: https://api.anaconda.org

SpecNotFound: Can't process without a name

(account_service) crawler@linux:~/PycharmProjects$ conda list


# packages in environment at /home/crawler/anaconda2/envs/account_service:
#

(account_service) crawler@linux:~/PycharmProjects$ conda info --envs


# conda environments:
#
account_service * /home/crawler/anaconda2/envs/account_service
brat /home/crawler/anaconda2/envs/brat
root /home/crawler/anaconda2

(account_service) crawler@linux:~/PycharmProjects$ conda list --explicit


# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64

You might also like