Due a new requirement on my Django app, I started using zeep. I installed it as usual throught an existing virtualenv.
The problem is that, when i tried to deploy my app, using Apache and mod_wsgi, it doesn't work, returning the following error:
ImportError at /prwn/
cannot import name python_2_unicode_compatible
/home/prwn/env/lib/python2.7/site-packages/zeep/wsdl/definitions.py in <module>
from six import python_2_unicode_compatible
The weirdest thing is that when my app is ran using runserver and the same virtualenv, it runs fine.
I tried creating a new virtualenv, a new Apache's virtualhost, even changing the permisions to 777 to the whole virtualenv,
and still not working.
I use the versions 0.23.0 of zeep, 1.10.0 of six and python 2.7
Well, at the end i figured it out. Oddly, when my app was running with Apache, it used the old version of the six library, wich was installed globally on my system.
I solved it upgrading the global six library to the new version, and it worked.
solved it using 'pip install --upgrade six'
this is because of the older version of six < 1.9.0
Related
Probably stupidly I tried to install the latest version of Python, in this case using the download from python site, but after doing that I was then getting python still running on the previous version python-3.6. I'm on OSX and was using sublime.
So I have been trying to work out how to update it to use the newest version. I've followed; https://opensource.com/article/19/5/python-3-default-mac.
All of the responses to queries now point to the python-3.9.5 version. So that's great and my runtime is using that. However after installing the requests using pip install I get the following error when running.
import requests
ModuleNotFoundError: No module named 'requests'''
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
I stumbled upon Modules are installed using pip on OSX but not found when importing which I have been trying to work through.
I have been able to run the import command successfully in terminal, however it's intermittent as I've tried again and it's broken, so I'm lost. I'm running it something trying to run the python3.6 version, which after updating I followed these instructions to remove when I have uninstalled that from my mac https://www.macupdate.com/app/mac/5880/python/uninstall.
If there is any ideas, would love some help, mainly to try and tell me what that error message is telling me.
In particular, what does this mean?
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/
I should clarify too; when I run 'pip list'
I see
requests 2.25.1
Assuming that you are not installing requests package properly, and assuming your python executable is named python:
python -m pip install requests
If however, your python executable is named something else instead, e.g. python3, replace python with that name:
python3 -m pip install requests
I am trying to follow a tutorial book called "Data visualization with Python and Javascript" and am running into many issues importing modules used in the book. I have made sure to do "pip install" on as many of the packages used as possible, and have successfully done it for packages such as SQLAlchemy and matplotlib.
However, when I import modules from SQLAlchemy and even dateutil that are used in the tutorial, I receive an import error, "ImportError: No module named {module}"
On the following lines of code:
from dateutil import parser
from SQLAlchemy import create_engine
This has occurred often enough with different modules that I am beginning to get concerned I can no longer actually follow the tutorial. I had to skip a whole section of how to use SQLAlchemy.
Furthermore, SQLAlchemy is properly installed:
Requirement already up-to-date: sqlalchemy in c:\users\{user}\appdata\local\continuum\miniconda3\lib\site-packages (1.2.15)
What obvious thing am I missing here that needs to happen for me to use these packages and modules?
EDIT:
python --version
Python 3.7.1
pip --version
pip 18.1 from C:\Users\{user}\AppData\Local\Continuum\miniconda3\lib\site-packages\pip (python 3.7)
However, I am using Anaconda for a virtual environment, and PyCharm as my IDE. I have included a screenshot of the projects interpreter for a good measure.Project Interpreter
Furthermore, I have checked that I have pip installed it on both the root and the environment.Root Environment
I think, you have multiple python versions installed.(2.* | 3.*)
You are installing packages in one python version and using another python version.
EDIT:
You can use pip2 install modulename for python2
and pip3 install modulename for python3
When I use from flask import *, I get the error
ImportError: No module named werkzeug.exceptions
However, when I do pip freeze, I can see that Werkzeug==0.11.11 is indeed installed. How can I fix this?
I am asumming, that the wrong version of Werkzeug was installed in the fist place. This usually happens, when you have 2 versions of python installed, and you use 'pip' for installing dependancies rather than using 'pip3'. Hope this helped!
I had this problem with Yocto while installing python-flask from: http://git.yoctoproject.org/git/meta-virtualization.
The solution was to manually add python-werkzeug to my yocto image as well. I suspect that python-flask should depend upon python-werkzeug. Additionally, I had to add python-jinja2 as well to the image.
I faced same issue.
I got this error when working in python virtual environment.
I had to deactivate virtual environment. Then go to root user and install werkzeug using pip. After that it works in virtual environment.
I had installed quite a few flask packages only with pip, but that was not enough, I also got the error ImportError: No module named werkzeug.exceptions.
The hint of the other answer, mentioning python-flask and python-werkzeug, brought the main idea. In my case, the solution was to apt-get install python-flask. It installed werkzeug as a dependency and the error was gone.
I've been trying for a couple of hours already. It seems IDLE can't find any third-party module. I am a Python beginner.
Here is some info about my system:
OSX version: 10.11.5
python version: Python 2.7, Python 3.4, Python 3.5
The initial installation using pip (among other methods) seems to work fine. When I repeat the installation, terminal responds with:
Requirement already satisfied (use --upgrade to upgrade): pyperclip in
./anaconda/lib/python3.4/site-packages
However, when I go to IDLE (Python 3.4) and try to import the module, IDLE responds with:
Traceback (most recent call last): File "", line 1, in
import pyperclip ImportError: No module named 'pyperclip'
I have read that it may have something to do with my PATH or some virtual environment. I’ll be frank, I’m not sure what to make of these as they seem beyond my current ability.
This inability to import modules is becoming an almost insurmountable roadblock to advancing with Python. If you can offer any ideas on what I can do or can ELI5 the solution, I am forever in your debt?
It seems you are using conda, but you are trying to install the pyperclip module with pip. Have you tried running conda install pyperclip?
As stated here:
Because Conda introduces a new packaging format, you cannot use pip and Conda interchangeably; pip cannot install the Conda package format. You can use the two tools side by side but they do not interoperate either.
This is something similar to what's posted here: No Module named django.core
To reiterate, I'm getting this error on running "django-admin.py startproject mysite"(without the double quotes):
C:\Documents and Settings\fixavier\Desktop>django-admin.py startproject mysite
Traceback (most recent call last):
File "C:\Program Files\BitNami DjangoStack\apps\django\django\bin\django-admin.py", line 2, in <module>
from django.core import management
ImportError: No module named django.core
But the error still exists! Please help.
OS:Windows
Installed django using BitNami Django stack.
What happens if you try to import django from the Python shell? Type python at a command prompt, then type import django at the next prompt. I'm not familiar with BitNami, but you might want to consider just installing Django the normal way. Otherwise you're going to have a hard time getting answers to issues via Google. It's not hard to install on Windows. You can get a binary installer for Python, then install Django according to the instructions in the docs.
Bonus points (and not as complicated as it sounds): To make Python package installation fairly painless, you can then install pip (or you can install pip first and then run pip install django). In order to install pip, you'll need setuptools. Once setuptools is installed, you should be able to do easy_install pip, but that's the only time you should ever use easy_install as pip's a much better product.
Make sure you add the location of your django install to your PATH settings. Instant Django might also be an option for you http://www.instantdjango.com/.