Ask Your Question

How do I use installed Python packages from pypy?

asked 2012-02-25 00:17:02 +0000

Rob Spanton gravatar image

Here's an example:

% rpm -q PyYAML
% pypy
>>>> import yaml
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named yaml

I realise that this is because Fedora's python packages currently install into somewhere under /usr/lib/python2.7, and pypy is looking under /usr/lib/pypy-1.8. Is there some magic fu that I'm missing that will make pypy work with all my installed Python packages?

Also, is there some kind of plan for making this kind of thing just work?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-02-25 14:20:36 +0000

KevinA gravatar image

Rob, Can you try to set the PYTHONPATH variable? That seemed to do the trick for me. Open a terminal and type the following:

gedit ~/.bashrc

When gedit opens add the following under the "User Specified Alias and Functions" section put the following line in there:

export PYTHONPATH=/usr/lib64/python2.7/site-packages/

Then just open pypy again and try to import yaml. It should succeed this time.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.


Asked: 2012-02-25 00:17:02 +0000

Seen: 7,701 times

Last updated: Feb 25 '12