Install otto on a Bitnami image of OpenEdX Cypress. Problems with virtualenv..

328 views
Skip to first unread message

Protocol Six Consulting

unread,
Oct 29, 2015, 11:45:01 AM10/29/15
to General Open edX discussion
Hi,

I have set up a working instance of OpenEdX on Amazon using an AMI-image from Bitnami.

Now I want to enable the Otto eCommerce service, but am getting stuck at the basic requirement of setting up an  active Virtualenv.

Any variation of the following command

# sudo virtualenv -p /opt/bitnami/python/bin/python2.7 /home/edx_ecommerce/python.venv/venv1

leads to output of the form:

Running virtualenv with interpreter /opt/bitnami/python/bin/python2.7
PYTHONHOME is set.  You *must* activate the virtualenv before using it
New python executable in /home/edx_ecommerce/python.venv/venv1/bin/python2.7
Also creating executable in /home/edx_ecommerce/python.venv/venv1/bin/python
Cannot locate wrapped file
ERROR: The executable /home/edx_ecommerce/python.venv/venv1/bin/python2.7 is not functioning
ERROR: It thinks sys.prefix is u'/home/bitnami' (should be u'/home/edx_ecommerce/python.venv/venv1')
ERROR: virtualenv is not compatible with this system or executable




I'm not a Python developer, but the basic action required seems straight-forward.

Googling around for this error has led me to try many variations of the command above, but they all had the same outcome.

I've tried:
- Virtualenv with and without the Virtualenvwrapper.
- specifying different Python versions (or no python versions) in the command
- installing virtualenv via pip and via apt-get
- different venv command options and environment variable
- virtualenv alternatives like  "python3.4 -r venv py3.env1"

Are there known issues setting up Otto on the Bitnami images of EdX?

(Bitnami is one of the few user-friendly paths to trying OpenEdX, so ideally Otto should be workable with this path)

Any ideas, advise or help would be appreciated.

:-)


Protocol Six Consulting

unread,
Nov 2, 2015, 10:15:29 AM11/2/15
to General Open edX discussion
Problem solved.

The key with virtualenv on Bitnami seems to be to run the command on the "bitnami console"

More info about this here: https://wiki.bitnami.com/Components/BitNami_console
----

So specifically for me the steps were:

# cd /opt/bitnami
# sudo ./use_edx
# virtualenv -p /opt/bitnami/python/bin/python2.7 /home/edx_ecommerce/venv1


Running virtualenv with interpreter /opt/bitnami/python/bin/python2.7
PYTHONHOME is set.  You *must* activate the virtualenv before using it
New python executable in /home/edx_ecommerce/otto.venv/bin/python2.7
Also creating executable in /home/edx_ecommerce/otto.venv/bin/python
Installing setuptools, pip, wheel...done.
.
.
.
The remaining otto install steps have to be run the same "bitnami console" !

Sarina Canelake

unread,
Nov 2, 2015, 10:24:01 AM11/2/15
to edx-code
Hello,

Please note that we don't recommend using the Bitnami image to host your production instance. See https://open.edx.org/blog/open-edx-cypress-virtual-machine-images-now-available-thanks-bitnami for more detail:

"The VM is an excellent way for you to try out the Open edX platform. It is easy to get up and running with the software and play around with it in this trial mode. However, single VMs have scalability limits and are not recommended for production sites."

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/f13f3910-5f8f-4f2c-8af3-96e79e02f556%40googlegroups.com.

Protocol Six Consulting

unread,
Nov 2, 2015, 7:31:54 PM11/2/15
to General Open edX discussion
Some more info for those who choose to use the Bitnami images to test/demo OpenEdX....

After getting virtualenv running on Bitnami (as above), the following additional steps are necessary: (All on the "Bitnami console"!!!)

------
0. pip install Django

1. sudo apt-get install libffi-dev
to allow Otto's "make requirements" to succeed (probably for paypalrestsdk==1.9.0 install) 

2. edit .bowerrc to say:

{
  "directory": "ecommerce/static/bower_components",
  "allow-root": true,      <== this is added to allow bower to build within the Bitnami console; I know allow-root is not recommended for bower
  "interactive": false
}

3. then run "make requirements" as per Otto instructions : http://open-edx-ecommerce-guide.readthedocs.org/en/latest/getting_started.html

4. sudo apt-get install libsqlite3-dev
5. pip install pysqlite
6. "make migrate" to prep sqlite3 db
7. finally "python manage.py runserver 8002" to start Otto as in the  Otto docs

------------

Just to re-iterate, the steps above are all performed on the "Bitnami Console", so if you want to log out of your test/demo EdX server, then you may need to use something like tmux or screen to keep the otto micro-service running!

Hope these instructions help someone, but of course *use at your own risk*.

:-)

Protocol Six Consulting

unread,
Nov 22, 2015, 1:01:12 PM11/22/15
to General Open edX discussion
One more thing...

On step 6, when you run "make migrate" you may encounter an error: "ImportError: No module named _sqlite3"

This seems to be a known error on Bitnami (and elsewhere)

The way I got around this was to edit /home/edx_ecommerce/otto.venv/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py

and replace "_sqlite3" with "sqlite3". The sqlite3 module exists on bitnami as libsqlite3

Also, in the same file I changed

   try:
            value = sqlite3.adapt(value)
        except _sqlite3.ProgrammingError :
            pass

to

   try:
            value = sqlite3.adapt(value)
        except :
            pass

All this let migrations work fully.

Hope that helps  :-)

yamil quiñones

unread,
Sep 25, 2016, 3:32:51 AM9/25/16
to General Open edX discussion
Hi,
Currently I have open Ubuntu 14.04.3 LTS edx in with bitnami.
I'm trying to migrate from Cypress to Dogwood.
For this I run the following commands:
  1.     cd /opt/bitnami/
  2.     ./use_edx
  3.     cd /opt/bitnami/apps/edx/edx-platform/
  4.     ./migrate.sh -c fullstack -t named-release/dogwood

Get the following error: (see picture)


any idea?

waiting for comments. 

regards
Reply all
Reply to author
Forward
0 new messages