ImportError: No module django_nose - python

I following this pluralsight course and running into this error everytime I run the command:
python manage.py test --settings=todobackend.settings.test
I'm new to the Django framework; Could the problem be that my django version (1.9.0) only supports python 3.x and not 2.x?
python --version
Python 2.7.13
Click on pic to see larger, clearer image.

It looks as if you have not installed django-nose in your virtual environment. You can install it with:
pip install django-nose

Related

Vercel CLI Pyhon version issue when deploying Django project

When running the vercel command in Ubuntu terminal:
Error! Command failed: python3.6 /tmp/2de7da56/get-pip.py --user
ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please > use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.
python --version returns 3.8.10.
pip --version returns 22.0.4.
vercel --version returns 24.0.1
requirements.txt just has Django == 4.0.3
What I tried:
Ran the script linked in the error message and added its installation directory to PATH.
Updated pip in default directory to 22.0.4.
Even aliased python3.6 to python at one point.
Tried on both Windows and Ubuntu.
I faced the same error when I recently tried to host my Django rest framework project on vercel.
I think the problem is that due to a recent update by pip the minimum version it now supports is python 3.7.
Am assuming you followed jayhale's post on Django deployment to vercel like I did. The problem is that the script in his tutorial runs on python 3.6 that's why vercel is giving out "ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please > use "https://bootstrap.pypa.io/pip/3.6/get-pip.py" instead."
I wrote a post about the work around I found. Just click on the link below and follow the steps in the post.
Link
P.s the new script works with python 3.9

Cannot use ImageField because Pillow is not installed when it is in fact installed

Hello I've been trying to add an ImageField for one of my models in my Django app.
When I ran the following code:
python3 manage.py makemigrations
A statement came out, saying I needed to install Pillow, which I did ('Successfully installed Pillow-8.2.0').
However, when I tried to run makemigrations again, the following error occurred:
(fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
I am aware that there are several threads out there that have discussed similar issues (like python/django - "Cannot use ImageField because Pillow is not installed") and I have tried doing whatever was recommended (reinstalling 64-bit Python, upgrading pip, making sure I don't have PIL, attempting to install an older Pillow version) but none worked.
Particularly, attempting to install an older Pillow version caused errors with the following message:
Pillow 7.1.0 does not support Python 3.9 and does not provide prebuilt Windows binaries.
I am using Windows 10, Python 3.9, Django 3.2.0 and Pillow 8.2.0 . Would really appreciate it if anyone can help me with this, thank you!
first of all; there are some questions to be clear in order to provide input for it. Questions like;
1- Do you activated your virtualenv,
2- How did you check if Pillow installed correctly?
.......
normally, activate virtualenv and then, run the command
pip freeze
this will list down all of installed packages.
Just type
pip3 install pillow
Hope this works

Pipenv won't lock after package install with python 3.8 due to python version

I have python 3.6 and 3.8 on my machine. I initialize a pipenv with:
pipenv --python 3.8
I do this otherwise by default it initializes with 3.6
This works well. However, whenever I try to install a package (my use case was with aiohttp) I get the following error:
pipenv.patched.notpip._internal.exceptions.UnsupportedPythonVersion: dataclasses requires Python '>=3.6, <3.7' but the running Python is 3.8.0
I get this with:
pipenv install aiohttp
I then tried with a different package (tldextract) and got the same error message.
I can't find other references for this issue online.
Any help would be appreciated.
Thanks!
Python 3.8 is recent release python release and not every packages has support for it yet. Its clearly said in pip dataclasses requires Python '>=3.6, <3.7' but the running Python is 3.8.0, which means the Python 3.8 is not supported by these libraries yet.
If you see the pip page for aiohttp, Python3.8 is not yet supported. So please check for supported pip-packages before installing them.

How to load python modules on CentOS 7?

Hello. I am using CentOS-7. As you all, know CentOS-7's default installed python is 2.7.5. So I've installed python 3.4 by yum from epel repository. Now in terminal, "python" runs python 2.7.5 and "python3.4" runs python 3.4.
This is good. But the problem is...Today I've downloaded mysql connector for python from here, and installed using yum. After that, When I try to import module in python 3.4, below error had occurred.
Import Error: No module named 'mysql'
But in python 2.7.5, that module import properly.
What should I do to import that module in python 3.4?
When you install via pip, it's installing for the specific/default Python version. So when you installed mysql, it installed to 2.7.5. Use pip3.4 or pip3 to also install it for Py3.x.
Edit: Since you're not doing it via pip, the module you're downloading - you need to download and install again for the correct Python version. They have different installers listed per platform, by bitness (or source which is platform independent) & Pyversion.
The module you install from yum depends on the current python version.
So first download virtualenv which contains your required python version (in your case https://virtualenv.readthedocs.org/en/latest/ ).
After that activate this virtualenvironment like this -
Go to the folder where you installed virtualenv from terminal.
Type source virtualenv/bin/activate.
After this run yum install command for your desired mysql connector.
This will download the mysql connector which is compatible with python 3.4.
You don't. You reinstall it again either from a package (not the same package, a different one) or by building it from source for 3.4.
download virtualenv and set the python3.4 environment
download related module in this isolated environment

Robot Framework installation issue

Whenever i try to install Robot Framework. I am getting the error message below.
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
What is the issue?
I am installing robotframework-2.6.3.win32 with python2.7.2
I'm not sure what is causing your specific issue, but I find that using pip or easy_install works for installing robotframework and any plugins on windows
Do you change your installed Python folder name ? Please use internal set-up command line in Python for adding plugin.
I'm assuming from the win32 extension that this is for Windows. In which case I would suggest checking installing with pip which can be found in section 1.3.3
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
Check if pip is installed with your python version
pip --version
Else use below link to install
https://pip.pypa.io/en/stable/installing/
once pip is installed , you can try to install robotframework with specific version like below
pip install MySQL_python==1.2.2
I'm not sure the cause for your issue. but you are trying to install an older version of Robot framework on an Older python build. I suggest you to try a newer version such as 'Robot Framework 3.2.2 (Python 3.7.9 on win32)'. Then, it's easy since pip is installed by default if you are using Python 2 >=2.7.9 or Python 3 >=3.4. (you can check by > "py -m pip --version")
Installing Robot Framework is just a two-step process now.
install python from https://www.python.org/downloads/
install robotframework from https://pypi.org/project/robotframework/ > "pip install robotframework" (You can check the version by > "robot --version")
Read more - https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#installation-instructions

Categories

Resources