Using Flask and Jython under Windows 7 - python

Hello everyone,
So I have been trying to use Jython to connect to an API Rest and retrieve some information. Now I want to use the Flask Framework with it. I have been trying to install the Flask with Jython but it does not seem to work at all. I am working on a Windows 7 machine and the problem for me is also that I can not download directly from the internet. For all other framework I used python wheels and installed these with Jython which worked fine.
I already tried to following commands and got these errors:
First error that I got was that it could not find the 'init.py' file in the flask folder so I changed the path in the file to the total path. But it just continued to give me more errors.
jython -m pip install '*.whl
Screenshot of the command line ouput of the error
pip install '*.whl (same as above)
I am a little stuck here and I hope that someone has an idea on how to solve this problem.
Big thanks already!!

This appears to be a bug with Jython 2.7.0. See this error report in pip and this one in Jython.
The second of those indicates that it is fixed in the 2.7.1 release candidate.

Related

How do I fix this python converting file into an app - still have not found a solution

This question is not a duplicate of this question, because I am trying to create an app.
I am currently following this tutorial, but when I try to run my app,
my command prompt prints out this error:
Why does this error happen and how can I solve it? I read through all the answers to the linked question, but none of them are pertinent to my problem.
Please anyone help me, I still haven't found a working solution; I am getting desperate!!!
Edit: I can't just install and uninstall pynput? Idk why it doesn't work because shouldn't pynput come with idle?
Version: 3.74 python idle, most updated version of pyinstaller
The following might help you if you haven't tried them already:
Update pip from the command line
Unistall pyinstaller
Re-install pyinstaller and try it again
If the above does not work, try running the following command in the command line. Make sure there are some print statements in your code to see if it works.
python monitoring_culmination_product.py
If you got a message saying "python is not recognised as an internal or external command" then python might have not been added as an environment path.Try this to fix the issue.
You could always re-install python if things get difficult.(make sure you install the appropriate version 32-64bit)
If the command though executed without a problem. Try to use pyinstaller on another file to see if the problem has to make sure the problem has to do with pyinstaller.
From a personal experience, pyinstaller can be unreliable at times so I put the following line in my projects just to make sure. It might help you too.
import pkg_resources.py2_warn
Disclaimer: Although it is not specified I assume that you are using Windows
You could try to use conda create to get an environment containing all the need dependencies (numpy, etc) and then use pyinstaller as explained in this discussion.
Please fall back to 1.6.8 version of pynput. pip install pynput==1.6.8
Ref : https://stackoverflow.com/a/63721929/14759065

'Web' module cannot be found while having installed lpthw.web

I'm currently doing the exercise in "Learn python the hard way".
In this exercise i have to install the lpthw.web frame work.
Having installed pip in windows, i open my terminal and hit
pip install lpthw.web
Everything then ends succesfully.
But when i browse C:\Python27\Lib\site-packages\lpthw.web-1.1-py2.7.egg-info and check the installed-files text i can't see the web.py.
Consequently when i try to import it in a simple script i get ImportError.
I don't have python 3 installed as book suggested for possible cause, so i don't know how to work around it.
Any suggestion?
I checked my path
import sys
sys.path
and saw that every single line was using the panda3d path.
As i was not really using it, unistalling it fixed my problem.
For me it was python version control on raspberry pi
(linux) 2.7 is default and does not work.
follow:
https://learn.sparkfun.com/tutorials/python-programming-tutorial-getting-started-with-the-raspberry-pi/configure-your-pi
have other errors now but the import web loads in python.
cheers!

Error when installing Zope Interface 4.0.3 on Python 2.7 needed for Scrapy

New to Python and Scrapy. I need these modules apparently to run scrapy properly. I downloaded Zope interface as suggested and have been attempting to install using easy_install as per instructions on Scrapy. I'm running Windows 7 64 and first downloaded the 64 bit version of Pyton 2.7 and all modules including Zope. That didn't work, so I unistalled everything and downloaded the 32 bit versions, but I'm having the same problem. Clearly, I'm doing something very basic incorrectly. Would appreciate assistance.
This is what happens:
C:>easy_install zope.interface-4.0.3-py2.7-win32.egg
I get a whole bunch of results (which stackoverflow doesn't let me copy/paste even though I'm properly formatting it as code) that says at the end:
No local packages or download links found for zope.interface-4.0.3-py2.7-win32.egg
I know I need zope, because when I try and run srapy, I receive the following error (also other results):
C:>scrapy shell http://www.yahoo.com
raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.
As I said, I'm real new at this and having a tough time with all the modules and packages needed to get going.
easy_install and pip install take package names, not the filename.
so the correct invocation would be
easy_install zope.interface
which will fetch the latest version. If you specifically want that version
easy_install "zope.interface==4.0.3"
You can usually find package names by googling, eg. pypi zope interface
I've spent an absurdly long time trying overcome the zope problems when installing scrapy and just found a solution!
I just followed step 7 here (as Talvalin suggested)
http://steamforge.net/wiki/index.php/How_to_Install_Scrapy_in_64-bit_Windows_7
Then, in my site-packages location I just changed the name of the egg file "zope.interface-3.8.0-py2.7-win-amd64.egg" to "zope". All worked fine after that.
Hope this helps somebody!

Setting up RhodeCode on windows server 2008 r2

I am trying to set up RhodeCode on WS2008R2, but keep on receiving the following error message at the "pip install rhodecode" stage:
"couldn't import standard bz2 (incomplete python install)"
this seems to happen at the stage when the installation process tries to install mercurial.
I am not quite sure where to go with this, as I have zero experience with python. I am following the guide provided from rhodecode: guide
Python version is 2.7.
Please help!
Ok it seems as if rhodecode have updated their step-by-step installation process and have included sections for 64-bit OS systems. Have tried on windows server 2012 and it works!
Link to guide

Running django-admin.py startproject is giving me an error

I've just started looking into python and django.. Im pretty sure ive successfull installed both python and the django framework and i managed to add python and django-admin.py to my system path but now when i run the command django-admin.py startproject My_Test_Site, in the folder i want to create a new project directory in (just following the tutorials), i get the following error:
What am i doing wrong?
This is not a Django error. It appears it cannot find the Python module unicodedata which is part of the Python Standard Library (docs). I see that there is also a bug report about this issue (Python 2.7 on Windows, see here). On the other hand, some people there report that reinstalling their Python installation fixed the problem. You could give that a try.
notice the last line, it says import unicodedata, importError
im guessing you probably didnt install your django properly.
so reinstall it and check that django is in your "path", i believe django does this automatically when it installs but doesnt hurt to double check.
if reinstalling django still doesn't work, i suggest you uninstall python and django related stuff.
then install python, install pip, then use pip install django.

Categories