After building from source. How do I use built version with pip and virtualenv?


So this is a python newbie question. After successfully building from source on my mac. I then did:

cd python
sudo python install

In the mxnet folder where the project was built.

I can then run the examples etc fine.

I understand this installs mxnet in my global python.

If I then later want to set up a project with virtualenv and then do pip install. How can I specify I want this specific version of mxnet that I built from source?


Once you have activated your virtualenv or conda env, go to the python/ folder under the incubator-mxnet folder where you built mxnet from source and run

pip install -e .

You can find this instruction under the Linux Build from Source selection of this page.


@safrooze now that Turi 4.1 is out I was attempting this again. However when trying to pip install my own compiled mxnet into the Turi virtual env I’m running it comes back with:

    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/hn/2_p67dxn4w710gwncfhjn30m0000gn/T/pip-C__5ZC-build/", line 46, in <module>
        LIB_PATH = libinfo['find_lib_path']()
      File "/private/var/folders/hn/2_p67dxn4w710gwncfhjn30m0000gn/T/pip-C__5ZC-build/mxnet/", line 59, in find_lib_path
        'List of candidates:\n' + str('\n'.join(dll_path)))
    RuntimeError: Cannot find the files.
    List of candidates:

Any pointers to why this would be?


@helloniklas sorry for delayed response. I’ve never used Turi. Did you find a solution? If not, try setting LD_LIBRARY_PATH environment variable to the directory that contains (under lib/ folder of mxnet source tree).