2

I am having trouble deploying my app on pythonanywhere.com. I have followed instructions to get teh django rest frameowrk package installed via pip by running the following

pip install --user djangorestframework

When I go into my console and run pip freeze it outputs djangorestframework==2.4.3 as one of the installed packages.

However, if I got to my python console and try import rest_framework or try to add rest_framework as an installed app in my django settings, I get this error.

ImportError: No module named 'rest_framework'

How do I get it to be recognized by my console and my application?

4

1 回答 1

3

原来是python版本的问题。它正在 python 2.7 下安装 rest_framework,而我的应用程序使用的是 python 3.3。要为 python 3.3 安装它,我运行了以下命令。

pip3.3 install djangorestframework

于 2014-10-14T02:45:47.950 回答