3

I've used pip-2.7 install --user soundcloud to install the soundcloud module for Python 2.7 in Pythonanywhere.

In my Web2py App in Pythonanywhere, I get an error message when using import soundcloud, stating that the soundcloud module does not exist. Is it not possible to for Web2py to access a module installed on Pythonanywhere (that did not come pre-packaged)?

mrl
  • 1,467
  • 2
  • 14
  • 22

1 Answers1

2

As long as Web2Py can find it on the path then yes it will work. Before you try and import soundcloud you might need to do something like:

import sys
sys.path.append('/home/markstadt/.local/lib/python/site-packages')
import soundcloud

Printing out sys.path from inside the web2py application and printing soundcloud.file from in a bash shell should give you all the information you need in order to add the correct directory to your path.

[Edited to add some extra info]

Web2Py has it's own site-packages folder that is automatically added to the path. See here: https://www.pythonanywhere.com/forums/topic/178/ and How can I use modules in web2py?

Community
  • 1
  • 1
aychedee
  • 24,871
  • 8
  • 79
  • 83
  • I opted to simply copy the module files into the app/modules directory as suggested in the links, because I wanted to avoid changed `sys.path`. Thanks for your help! – mrl Jul 16 '12 at 20:39