I am new to Web2Py and Python stack. I need to use a module in my Web2Py application which uses "gensim" and "nltk" libraries. I tried installing these into my Python 2.7 on a Windows 7 environment but came across several errors due to some issues with "numpy" and "scipy" installations on Windows 7. Then I ended up resolving those errors by uninstalling Python 2.7 and instead installing Anaconda Python which successfully installed the required "gensim" and "nltk" libraries.
So, at this stage I am able to see all these "gensim" and "nltk" libraries resolving properly without any error in "Spyder" and "PyCharm". However, when I run my application in Web2Py, it still complains about "gensim" and gives this error: <type 'exceptions.ImportError'> No module named gensim
My guess is if I can configure Web2Py to use the Anaconda Python then this issue would be resolved.
I need to know if it's possible to configure Web2Py to use Anaconda Python and if it is then how do I do that?
Otherwise, if someone knows of some other way resolve that "gensim" error in Web2Py kindly share your thoughts.
All your help would be highly appreciated.
The Windows binary includes it's own Python interpreter and will therefore not see any packages you have in your local Python installation.
If you already have Python installed, you should instead run web2py from source.
Related
When using runtime version 1.8, i'm getting this error when I tried to import cv2:
/usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so: undefined symbol: _ZN2cv9Algorithm7getListERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE
Anyone knows if there's any workaround? Looks like glib needs to be installed in the image, but it wasn't.
Cloud ML images already has installed the python-opencv package. If you are facing the issue in your local environment instead of CloudML, most probably you have dependencies problems, for example when two different programs modify the same package. Other similar threads that solved the issue are:
Related to PKG_CONFIG_PATH.
Related to differences between pip versions 2.7 and 3.4.
I found this tutorial that may be useful for you Running a Spark Application with OpenCV on Cloud Dataproc.
I just tried deploying my Django application on my windows machine using Bitnami's Django stack. However, when I try to access my project via localhost/myapp/, I get an error stating that I can't load my modules/python libraries. I checked via pip and I have these modules installed. It seems this error applies to all my modules/python libraries. How do I solve this? Thanks!
When you install the Bitnami Django Stack, it will ask you for changing Association Setting for Python with the following message:
"This option lets you change the Windows properties to associate the Python files to the new Python that are going to be installed. If you have your own Python you may want to disable this feature."
If you decided to use your Python instead of the one that is installed with the Stack, you have must ensure that you have installed Python in your system and all the modules and libraries are loaded, otherwise you won't be able to use any of them.
I just put up a django application online and i'm getting this error in my error log
Fatal Python error: PyEval_AcquireThread: NULL new thread state
I have seen a few similar questions online, but they do not explain this error.
The problem can appear if apache mod_wsgi and mod_python are both enabled.
Try
sudo a2dismod python
sudo service apache2 restart
This tends to indicate that your mod_wsgi is compiled for a different Python version and/or a different Python installation than the Python virtual environment or Python installation it is trying to use at runtime.
In other words, you are mixing compiled shared library and extension modules from different Python installations. This can cause all sorts of problems.
Go through the checks in:
http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation
to understand how your mod_wsgi has been built and verify it is what you expect it to be.
In my case it was permissions for the directories where Django or Flask project are. They were created from root, so I changed them to www-data in my case.
I'm currently trying to deploy a site-package using Python 2.7 in a project written in C++ and using SWIG. Everything works very well. Our application is distributed to many clients, and we have one big existential question: should our installation package install Python itself (let's say in 'C:\Python27'), or should we include only the python27.dll along with the DLLs and Lib folder of Python, as explained here: C++ with Python embedding: crash if Python not installed
For the embedded way of using our site-package, I see no problem of not installing Python using its install program (from python.org). But for the extended usage, if we take the approach of NOT installing Python on the client machine, I am wondering what will happen if the client installs another thid-party library (like numpy). Will numpy work even though Python 2.7 has not been installed properly (no registry keys have been set, etc.) And if the client wants to use IDLE or PyDev, how can he do that if Python has not been previously installed on its machine?
I'm a Windows user. I tried to install django-1.0.2 final through the command prompt and it kept giving me an error in line 70:
The error occured where u"SVN"... It couldn't get past that line.
What to do in order to be able to install django-1.0.2?
You do not have SubVersion installed on your machine. You are trying to synchronize from the current production stream via SubVersion, which is a source control system, which you do not have installed.
Easiest solution - download the latest official version per the instructions at http://www.djangoproject.com/download/
Please install a client for the Subversion Version Control System. Since you are on Windows, you can also use TortoiseSVN which is an easy to use SVN client for Windows.
Alternately, you can download the tarball of Django 1.0.2 directly.
And please don't SHOUT on Internet forums. We hear you :)
If I recall correctly, installing TortoiseSVN won't help you there cause Django's code tries to use SVN's command line version.
Install a command-line SVN like:
Slik SVN
CollabNet SVN Command line
What version of python are you using? I had the same error when installing on top of python 3.2 instead of 2.7. Django only works with 2.7.
http://docs.djangoproject.com/en/1.2/faq/install/#can-i-use-django-with-python-3