19

I have downloaded Python3.3 and after unzipping it I issued ./configure, make and make altinstall. When I issued python3.3, the following message was shown:

Fatal Python error: Py_Initialize: Unable to get the locale encoding

ImportError: No module named 'encodings'

Aborted

I checked the Python environment variables and they seem to be okay.

In my .profile I inserted the following lines:

export PYTHONHOME=/usr/local/lib/python3.3/:/usr/local/lib/python3.3/lib/:/usr/local/lib/python3.3/lib/site-packages/
export PYTHONPATH=/usr/local/bin/
export PATH=$PYTHONPATH:$PATH

I then did source .profile, but Python won't start.

In Eclipse, after installing pydev, when I attempted to add the Python interpreter from /usr/local/bin, I got the following message:

No output was in the standard output when trying to create the interpreter info.
The error output contains:>>Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
  File "/home/sabya/eclipse/plugins/org.python.pydev_2.7.3.2013031601/pysrc/interpreterInfo.py", line 52, in <module>
    import time
ImportError: No module named 'time'

I am at loss to understand what else I have to set in order for Python to work. I am running OpenSuSE 12.3.

4

2 に答える 2

2

Heroku でこの問題が発生した場合は、「python-3.5.2」またはhttps://devcenter.heroku.com/articles/python-runtimes#supported-pythonにある最新のランタイムを使用して runtime.txt ファイルを作成してください。 -ランタイム

これにより、Heroku は Python 3.x ランタイムを使用することを認識できます。

于 2016-01-03T05:30:42.320 に答える