Hello, thanks for your answer.
I installed python 3.6 from another PPA and it works fine now. I just wish pip were aware of those requirements.
On Tuesday, March 24, 2020 at 1:35:03 PM UTC+1, Andréas Kühne wrote:
Hi,First of all - you need to make sure you are using the python 3 version for everything - you can't mix and match python versions. So make sure that python 3 is the version you are using for everything,Second - python 3.5.2 is an old version of python 3 - you need at least version 3.6 for django 3.0 - and that could also be the issue with the other requirements. I would recommend upgrading to at least version 3.6, but preferably the latest python 3 version (3.8). Then you shouldn't have any issues with this?Regards,AndréasDen tis 24 mars 2020 kl 12:11 skrev Rodolphe Gohard <rg1...@gmail.com>:Hello, I am wanting to create a django project.--I followed the instructions on installing django here:https://docs.djangoproject.com/en/3.0/ and here: https://docs.intro/install/ djangoproject.com/en/3.0/ intro/tutorial01/ But I have encountered multiple problems and am stuck.My env:Ubuntu on WSL
python 2.7
python 3.5.2Here is the steps I took so far:# create the venv
sudo apt-get install python3-venv
python3 -m venv pythonenv
source ./pythonenv/bin/activate
python -m pip install Django
# until there it works
# now, I can't run django-admin startproject diagnosis-admin, fails everytime with a new errors
# pbs with secrets <- pyopenssl <- wheel <- libs
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
pip install wheel
pip install pyopenssl
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
pip install secrets
django-admin startproject diagnosis-adminit still fails with an error I don't know what to do with:(pythonenv) rodolphe@PHP140:~/dev/assistance -tool/diagnosis-admin$ django-admin startproject diagnosis-admin
Traceback (most recent call last):
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 328, in run_from_argvadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/base.py"
self.execute(*args, **cmd_options)
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 369, in executeadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/base.py"
output = self.handle(*args, **options)
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 18, in handleadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/commands/ startproject.py"
options['secret_key'] = get_random_secret_key()
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 82, in get_random_secret_keyadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/utils.py"
return get_random_string(50, chars)
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 46, in get_random_stringadmin/pythonenv/lib/python3.5/ site-packages/django/utils/ crypto.py"
return ''.join(secrets.choice(allowed_chars ) for i in range(length))
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 46, in <genexpr>admin/pythonenv/lib/python3.5/ site-packages/django/utils/ crypto.py"
return ''.join(secrets.choice(allowed_chars ) for i in range(length))
AttributeError: module 'secrets' has no attribute 'choice'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 11, in <module>admin/pythonenv/bin/django- admin"
sys.exit(execute_from_command_line ())
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 401, in execute_from_command_lineadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/__init__.py"
utility.execute()
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 395, in executeadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/__init__.py"
self.fetch_command(subcommand). run_from_argv(self.argv)
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 341, in run_from_argvadmin/pythonenv/lib/python3.5/ site-packages/django/core/ management/base.py"
connections.close_all()
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 225, in close_alladmin/pythonenv/lib/python3.5/ site-packages/django/db/utils. py"
for alias in self:
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 219, in __iter__admin/pythonenv/lib/python3.5/ site-packages/django/db/utils. py"
return iter(self.databases)
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 48, in __get__admin/pythonenv/lib/python3.5/ site-packages/django/utils/ functional.py"
res = instance.__dict__[self.name] = self.func(instance)
File "/mnt/c/Users/gohard.r/dev/assistance-tool/diagnosis- , line 22, in funcadmin/pythonenv/lib/python3.5/ site-packages/django/utils/ functional.py"
'Cannot use cached_property instance without calling '
TypeError: Cannot use cached_property instance without calling __set_name__() on it.
(pythonenv) rodolphe@PHP140:~/dev/assistance -tool/diagnosis-admin$ python --version
Python 3.5.2I didn't expect so many steps and missing/wrong dependencies, so I guess there must be something wrong in the env, or django/python version, but not sure where to look.Can anyone help ?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b291aeb4- .67c0-4089-970b-6ddd084e201d% 40googlegroups.com
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4fc173b1-4560-47f3-89f0-f3297667528e%40googlegroups.com.
No comments:
Post a Comment