Xblock SDK: Setting entry points for virtenv

Hi,

I´m trying to install the xblock SDK but the installation instructions are a bit vague (or I know too little about virtual environments for Python). I don´t know what I need to do on step 4. When I´ve activated the virtual environment and run “make install” I get an error saying

make: *** No rule to make target ‘install’. Stop.

How do I set the Xblock entry points?


Installation

This code runs on Python 3.5 or newer.

  1. Install standard development libraries. Here’s how you do it on Ubuntu or Debian:

    $ sudo apt-get install python-dev libxml2-dev libxslt-dev lib32z1-dev libjpeg62-dev

  2. Get a local copy of this repo.

  3. Create and activate a virtualenv to work in.

  4. Install the requirements and register the XBlock entry points:

    $ make install

  5. Run the Django development server:

    $ python manage.py runserver

  6. Open a web browser to: http://127.0.0.1:8000

Most likely you are running make install from the wrong directory. You must run it from the xblock-sdk directory.

The docker approach is probably easier - I tested these commands from the README on my computer now and confirmed they work:

git clone git@github.com:edx/xblock-sdk.git
cd xblock-sdk
docker build -t xblock-sdk .
docker run -d -p 8000:8000 --name xblock-sdk xblock-sdk
docker exec -it xblock-sdk python3 manage.py migrate

(Then it was running at http://localhost:8000/ )

Alternately, for the non-docker approach, the commands you need are as follows, but may not work if you don’t have the correct version of python or the correct system dependencies installed. However, I just tried these commands on my mac and they worked without issue.

git clone git@github.com:edx/xblock-sdk.git
cd xblock-sdk
python3 -m venv venv
source venv/bin/activate
make install
python3 manage.py migrate
python3 manage.py runserver

It’s probably worth mentioning that as an XBlock developer, I personally don’t use the XBlock SDK anymore, and just develop and test my XBlock directly in Studio+LMS. The XBlock SDK is useful for learning XBlocks and testing very simple XBlocks but for anything complex it acts differently than the LMS so is less useful.

Thanks for the reply @braden!

Now I getting a different error instead,

But would you suggest not bothering with the xblock-sdk then?
Do you know of any source of information besides the official docs on building xblocks?

You are using an old version of python - that’s why it’s not working. Create the virtual environment using Python 3.8 and it should work. Or follow the docker instructions which take care of those details.

There are two XBlock tutorials, at https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/ and https://doc.opencraft.com/en/latest/xblock-tutorial/ but I don’t think either have been updated since XBlock SDK was converted to python 3, which is why they didn’t explain this bug that you’re facing. Those are the only two that I know of.