Error when running tensorflow [duplicate] - python

When I run django project, I came across a strange problem as listed:
ImportError: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_AsASCIIString
If I I run this project in dev mode(python manage.py runserver 0.0.0.0:8000), it doesn't occur. But when I deploy this project in apache and then this problem occurs.
In this project, I use nltk package and mongodb, and numpy is a dependency.
My OS is CentOS 6.3 and I upgraded python from 2.6.6 to 2.7.3 which is compiled by myself.
Following some instructions, I recompile and rebuild python with ./configure --enable-unicode=ucs2. But that seems didn't work.
So any guys know the reason or solutions? Thanks a lot!

Rebuild NumPy against a Python built as UCS-4.

Related

no module named setuptools_rust

hellow i'm new to python and django. Currently i'm trying to run a project made in django 1.10.2 and python 2.7 in ubuntu 16.04. The project uses a module called python-social-auth, which causes me the following error when I try to install.
Hopefully you can help me in detail to solve this problem because as I told you I am new to using these tools.

Running Python in mod_wsgi in Apache Cannot See Python Modules in /usr/local/lib64/python3.6/site-packages

I have had scores of servers running a Python script via Apache and mod_wsgi for years now. I recently am building on RHEL7 and have run into an issue where my Python script calling R procedures are bombing out only via Apache stating it cannot find my pip installed Python modules in my Apache log.
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
This seems to only affect modules getting installed in /usr/local/lib64/python3.6/site-packages which is where my custom modules are being installed with pip.
Even if I append it, it ignores it.
sys.path.append(r'/usr/local/lib64/python3.6/site-packages')
I manually built mod_wsgi from source.
I'm ready to abandon mod_wsgi because I have to get my application deployed for my users.
Any help is greatly appreciated.
Thanks,
Lou
It was a file priv issue with /usr/lib64/python3.6 and /usr/lib/python3.6 directories and their child directories. Root ran fine, but running as Apache had no access. You had to chmod-R 755 on both directory trees. Worked fine with Apache after that. Sometimes it’s the simple things we forget to check first.

ImportError - Not finding Python Packages

I am stuck trying to get an application via Apache web server. I keep getting the following error.
ImportError: No module named flask
I believe this is because it might be pointing to the wrong Python. I had anaconda, but have removed that. When I check to see all the versions of Python, the following show up.
which -a python
/usr/local/bin/python
/usr/bin/python
Error: No module named flask
When I print the environment variables, here is the following:
printenv
PYTHONPATH=/usr/local/lib/python2.7/site-packages
The packages are all there as I have verified that with a pip freeze. Any help would be greatly appreciated as I have been stuck on this for a while. Thanks!
Your problem is quiet unclear answering from what i understood.
It seems like you have 2 python installed on your device. First find for which python all the modules are installed . Then simply mention the path of that python on the top of your script. If your case
#!/usr/bin/env python
or
#!/usr/local/env python

ImportError: No module named 'resource'

I am using python 3.5 and I am doing Algorithms specialization courses on Coursera. Professor teaching this course posted a program which can help us to know the time and memory associated with running a program. It has import resource command at the top. I tried to run this program along with the programs I have written in python and every time I received ImportError: No module named 'resource'
I used the same code in ubuntu and have no errors at all.
I followed suggestions in stackoverflow answers and I have tried adding PYTHONPATH PYTHONHOME and edited the PATH environment variable.
I have no idea of what else I can do here.
Is there any file that I can download and install it in the Lib or site-packages folder of my python installation ?
resource is a Unix specific package as seen in https://docs.python.org/2/library/resource.html which is why it worked for you in Ubuntu, but raised an error when trying to use it in Windows.
I ran into similar error in window 10. Here is what solved it for me.
Downgrade to the Apache Spark 2.3.2 prebuild version
Install (or downgrade) jdk to version 1.8.0
My installed jdk was 1.9.0, which doesn't seem to be compatiable with spark 2.3.2 or 2.4.0
make sure that when you run java -version in cmd (command prompt), it show java version 8. If you are seeing version 9, you will need to change your system ENV PATH to ensure it points to java version 8.
Check this link to get help on changing the PATH if you have multiple java version installed.
Hope this helps someone, I was stuck on this issue for almost a week before finally finding a solution.

mod_wsgi on archlinux with python 3.2

I actually had mod_wsgi working with python3.1, but after updating some software... it no longer works.
I followed these instructions for python3.1 modified slightly for 3.2:
https://wiki.archlinux.org/index.php/Mod_wsgi
and while it seems to build/install ok, trying to start apache give me the error :
Cannot load /etc/httpd/modules/mod_wsgi.so into server: /etc/httpd/modules/mod_wsgi.so: undefined symbol: PyCObject_FromVoidPtr
just as this guy got:
Python 3.1.1 with --enable-shared : will not build any extensions
Any help would be appreciated.
I am a linux noob.
The released versions of mod_wsgi cannot be used with Python 3.2. You must currently use source code directly from subversion repository for mod_wsgi. See:
http://code.google.com/p/modwsgi/source/checkout

Categories

Resources