Python 在pypy上安装pip
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42342075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Install pip on pypy
提问by 1pa
I want to speed up my program so i'm trying to setup pypy + psycopg2cffi. This program opens a xml, parses it and then insert some data in a database. I'm using currently python3, postgresql and psycopg2 but this approaches is really slow. So i want to try run my program with pypy + psycopg2cffi. I have python 3 and pypy, and i want to install psycopg2cffi so i ran this command:
我想加快我的程序,所以我正在尝试设置 pypy + psycopg2cffi。这个程序打开一个xml,解析它,然后在数据库中插入一些数据。我目前使用的是 python3、postgresql 和 psycopg2,但这种方法真的很慢。所以我想尝试用 pypy + psycopg2cffi 运行我的程序。我有 python 3 和 pypy,我想安装 psycopg2cffi 所以我运行了这个命令:
pip install psycopg2cffi psycopg2cffi-compat
But psycopg2cffi was only installed on python because when i try to import psycopg2cffi on pypy this is the error i get:
但是 psycopg2cffi 只安装在 python 上,因为当我尝试在 pypy 上导入 psycopg2cffi 时,这是我得到的错误:
ImportError: No module named psycopg2cffi
So i think i need to install pip first but i can figure out how to do this.
所以我想我需要先安装 pip 但我可以弄清楚如何做到这一点。
How can i install it on pypy? Thank you.
我如何在pypy上安装它?谢谢你。
回答by SebMa
You can also try this (if it's not disabled in your Linux distribution):
你也可以试试这个(如果它在你的 Linux 发行版中没有被禁用):
pypy -m ensurepip
回答by Mohamed Gamal
Download the pip-installer and execute it with pypy:
下载 pip-installer 并使用 pypy 执行它:
wget https://bootstrap.pypa.io/get-pip.py
./pypy get-pip.py
For usage try,
对于使用尝试,
pypy -m pip install validators