简体   繁体   English

Python便携式安装出现错误

[英]Python Portable Install gives error

i am starting to use Databases and am using MariaDB, Got that ready, but i want Python integration so i can get started on the program. 我开始使用数据库并且正在使用MariaDB,已经准备好了,但是我想要Python集成,这样我就可以开始使用该程序了。

I have downloaded PyMySQL-0.7.10.tar.gz from the official python website and have unzipped and have navigated an Command Prompt to there using cd (dir) . 我已经从python官方网站下载了PyMySQL-0.7.10.tar.gz,并解压缩并使用cd (dir)导航到了命令提示符。

My command is: 我的命令是:

"G:\Python\Portable\Portable Python 3.2.5.1\App\python.exe" setup.py install

(Yes, i am on Windows 10 and i am using Portable Python. This is because i learn it at school but also want to be able to work at it at home.) (是的,我在Windows 10上并且正在使用Portable Python。这是因为我在学校学习它,但也希望能够在家中工作。)

The error it returns is the following: 它返回的错误如下:

Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    version_tuple = __import__('pymysql').VERSION
  File "C:\Users\Natan Samuel Geldorp.Remytop-PC\Downloads\PyMySQL-0.7.10\pymysql\__init__.py", line 28, in <module>
    from .converters import escape_dict, escape_sequence, escape_string
  File "C:\Users\Natan Samuel Geldorp.Remytop-PC\Downloads\PyMySQL-0.7.10\pymysql\converters.py", line 60
    _escape_table[0] = u'\\0'
                            ^
SyntaxError: invalid syntax

Does anyone know how to fix this? 有谁知道如何解决这一问题?

-Natan -Natan

As requested, as an answer: 根据要求,作为答案:

You need a newer Python version, in 3.0 to 3.2 the u prefix was forbidden, it was allowed again in version 3.3. 您需要更新的Python版本,在3.0到3.2之间,禁止使用u前缀,在3.3版本中再次允许使用。

Since Portable Python is no longer being developed (according to their site) you need to pick an alternative. 由于不再开发Portable Python (根据其网站),因此您需要选择一个替代方法。 One suggested on the site is WinPython . 该网站上建议的一种是WinPython

(Also the PyMySQL site states that the minimum required Python versions are either >= 2.6 or >= 3.3) (此外, PyMySQL网站指出,所需的最低Python版本为> = 2.6或> = 3.3)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM