No module named jinja2 - apache

Im trying to deploy a Python3.2 app in my Ubuntu 12.04 server. Everything was fine, until I tried to use Jinja2 as my template system.
Im using virtualenv to use Pyhon3.2 instead of Python2, and I've installed other required libraries such as pymongo or bottle without problem. But now, my app fails because it says
ImportError: No module named jinja2
I've installed jinja2 the same way as I installed pymongo or bottle (using pip in the virtualenv), and they work just fine. If I try to install it again:
./virtualenv/bin/pip-3.2 install jinja2
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /var/www/virtualenv/lib/python3.2/site-packages
Cleaning up...
It says that it is installed. I've tried to uninstall and install again with no luck.
Im trying to run the application using mod_wsgi, and I know it's using the right virtualenv, because I don't get any errors due to Pymongo, Bottle, what are installed using the virtualenv pip.
Any ideas? :(

Jijna is not compatible with Python 3.2. See this

Related

Tensorflow-Text in Miniconda

I am trying to install tensorflow-text through miniconda in Spyder. I have managed to install other modules in Spyder such as tensorflow itself, pandas, scikit-learn, etc. However, using the same command as all the other installations (with the specific package name replaced by tensorflow-text)
conda install spyder-kernels tensorflow-text -y
I continue to get the same error whenever I try to install tensorflow-text:
PackagesNotFoundError: The following packages are not available from current channels:
- tensorflow-text
followed by a suggestion to search for the package on anaconda.org. As such, I searched for the tensorflow-text package on the anaconda site and found one, albeit for linux, by rocketce. Attempting to run the commands listed under the tensorflow-text installation instructions on that webpage also yielded the same error.
At first, I tried to install tensorflow-text through pip and was able to successfully run the command
pip install -U tensorflow-text==2.10.0
which seemed to install tensorflow-text. But I could not figure out how to access it or if it was correctly installed. Specifically, I am looking to use tensorflow-text in the Spyder IDE. I was able to get tensorflow working in the IDE, but not the specific tensorflow-text.
I am using a Windows 10 system; I could not find anything on the anaconda site for Windows 10. I am rather inexperienced (if you could not already tell from the nature and description of the problem), so patience and clear explanations are appreciated. Thanks in advance!

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Flask

I am trying to simply connect to the ibapi (Interactive Brokers API), but I am having some technical troubles with Python 3.7 .
What I did so far:
I installed the latest version for Windows 10 of the API
I ran C:\TWS API\source\pythonclient and run python setup.py install
I got:
ModuleNotFoundError: No module named 'ibapi'
when I try to import it
What I am doing wrong here and how can I fix this simple error?
My flask project is created in a virtual env named Ibconnect ( (IBconnect) C:\Users\Admin\dev\IBconnect> on the command Windows ) and I think that I have to install the python client here but I don't know how to do it.
Please try to use Anaconda - Spyder. In Anaconda prompt (just activates the conda environment) and navigate to the dir C:\TWS API\source\pythonclient and run python setup.py install

No module named tensorflow even after installing with pip

I'm trying to follow this guide to test this new algorithm: https://github.com/lalonderodney/SegCaps
I can't do it in my PC, so i'm using another server with Putty. Now I'm connected with the other server.
First of all I installed TensorFlow as indicates in the guide with :
pip install -r requirements.txt
After I wrote this code: ./main.py segcaps.png
in which segcaps.png is the image that i want to use
Finally I wrote python main.py --data_root_dir data
that is the only required parameter with the directory containing imgs and masks folders.
Now it gives me an error:
ModuleNotFoundError: No module named 'tensorflow.python.framework'
I searched it in the directory tensorflow/python/framework and it exists.
So, i don't know how to solve it. Ideas?
If you have multiple Python versions installed, then you'll (most likely) have multiple pip versions installed too. Make sure that the pip command you use installs the package(s) into the Python version you want it to. It may so happen that the package got installed into python2 but you wanted it in python3.
Since using pip did not install the packages in python3, pip3 is most likely to the PyPI for python3. Try
pip3 install -r requirements.txt
and that should work.
In case you have an EnvironmentError you can try this (bad idea):
pip3 install -r requirements.txt --user
This solves the problem most of the times on standalone machines. I'm not sure about the server; insufficient permissions might block this.
Why is the --user flag a bad idea? Read: What is the purpose “pip install --user …”?
You can use pip show tensorflow to see if it is installed or not.
As for ModuleNotFoundError try uninstalling keras and reinstalling an earlier version by pip install keras==2.1.6

Running tensorflow in ipython

tensorflow works using python in a virtualenv I created, but tensorflow doesn't work in the same virtualenv with ipython. This is the error I get:
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.
I have tried installing ipython within the virtual environment. This is the message I get:
Requirement already satisfied: ipython in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
If I try to uninstall ipython within the virtual environment. I get this message:
Not uninstalling ipython at /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Any ideas on how to get this to work? I don't know how to force the install of ipython to be inside the virtual environment. I've tried deleting the virtual environment and making a new one from scratch, but I get the same error.
I think I figured out the problem. pip was pointing to /Library/Frameworks/Python.framework/Versions/3.4/bin/pip
My ipython was pointing to /opt/local/bin/ipython
I re-installed tensorflow within my virtual environment by calling /opt/local/bin/pip-2.7 install --upgrade tensorflow
Now I can use tensorflow within ipython.

Pillow installed but not identified (Mac OS Yosemite)

I Installed pillow using brew, and when I try to repeat the isntallation I see it's there:
brew install Homebrew/python/pillow
Warning: pillow-2.7.0 already installed
But when I try to load it into a script I get an error:
ImportError: No module named Image
Any suggestions?
python usually looks for Pillow under normal site package installs. Here's what I would do to get a minimal Pillow setup where python should be guaranteed to see it:
sudo easy_install pip
pip install Pillow
I think it may also be possible to just do:
sudo easy_install Pillow
but pip is a bit more user friendly if you're planning on using more python scripts that might have dependencies.
Note: another issue you might be running into is if you're trying to use the Homebrew python but are ending up using the base OSX install of it instead. Make sure which python is showing you what you expect it to be.