How to install iPython in a Pypy virtualenv on Ubuntu 17.04

时间:2017-08-30 20:51:32

标签: ubuntu ipython virtualenv pypy

I'm trying to install IPython in a virtualenv. I've set up my Virtualenv to use Pypy 2.7 instead of CPython 3.

When I use the IPython installed by url(r'^(?P<id>[^/]+)/$', views.get_blog, name='one_blog'), , it ends up using CPython 3 instead of Pypy.

When I try to def get_blog(request, id): blog = Blogs.objects.get(id=id) return render(request, 'blogs/one_blog.html', locals()) , I get a compilation error because it can't find the {% extends "personal/header.html" %} {% block content %} <h5>{{blog.title}}</h5> {{blog.body}} {% endblock %} header file. This error is detailed here: https://askubuntu.com/questions/922302/install-ipython-with-pip-on-ubuntu-16-04. The suggested fix results in the error:

Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

[edit]

The complete error:

apt-get

1 个答案:

答案 0 :(得分:3)

您需要在创建virtualenv之前安装pypy-dev 。您可以看到gcc命令正在/ home / me / Documents / pypy-ipython-venv / include中查找包含文件,我担心只有在创建虚拟环境时存在头文件时才能正确填充目录。您可以通过查看该目录的内容来证明这一点,它应该有一个Python.h文件。

请注意,您只需要安装一次pypy-dev,之后您应该选择与您选择创建的virtualenvs一样好