English
Ask Your Question
2

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
PyYAML-3.10-1.fc16.i686
% 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 delete

1 Answer

Sort by ยป oldest newest most voted
2

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 publish link more

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

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 to your questions.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Stats

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

Seen: 2,961 times

Last updated: Feb 25 '12