# Install Jupyterlab in python virtual env in FreeBSD 13



## Schroter (Mar 22, 2022)

Hi All,

I am trying to install Jupyterlab on freebsd 13 using python virtual environment. Initially I ran into trouble. But searching online I was able to install it using;

```
export C_INCLUDE_PATH=/usr/local/include/:${C_INCLUDE_PATH}
export CPLUS_INCLUDE_PATH=/usr/local/include/:${CPLUS_INCLUDE_PATH}
```

But after Installation at launch I get another error:

```
(.venvML) [michael@schroter ~]$ jupyter lab
Traceback (most recent call last):
  File "/usr/home/michael/.venvML/bin/jupyter-lab", line 5, in <module>
    from jupyterlab.labapp import main
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyterlab/labapp.py", line 13, in <module>
    from jupyter_server.serverapp import flags
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 73, in <module>
    from jupyter_server.services.kernels.kernelmanager import (
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 15, in <module>
    from jupyter_client.multikernelmanager import AsyncMultiKernelManager
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyter_client/__init__.py", line 6, in <module>
    from .asynchronous import AsyncKernelClient  # noqa
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyter_client/asynchronous/__init__.py", line 1, in <module>
    from .client import AsyncKernelClient  # noqa
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyter_client/asynchronous/client.py", line 6, in <module>
    from jupyter_client.channels import HBChannel
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/jupyter_client/channels.py", line 12, in <module>
    import zmq.asyncio
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/zmq/__init__.py", line 61, in <module>
    _load_libzmq()
  File "/usr/home/michael/.venvML/lib/python3.8/site-packages/zmq/__init__.py", line 36, in _load_libzmq
    from . import libzmq
ImportError: /usr/home/michael/.venvML/lib/python3.8/site-packages/zmq/libzmq.cpython-38.so: Undefined symbol "_Ux86_64_getcontext"
```

Would you be able to help me in this matter please? I have  libunwind already installed using pkg.
Thanks & Best Regards
Schroter Michael


----------



## SirDice (Mar 22, 2022)

Any reason why you're not using the ports/packages we have for it? 






						FreshPorts -- Search
					

Search




					www.freshports.org


----------



## Schroter (Mar 22, 2022)

SirDice said:


> Any reason why you're not using the ports/packages we have for it?
> 
> 
> 
> ...


Hi, Thanks for the reply. I do not want to install python packages in a global environment. I think its safer and prefer the environments separate.
Thanks & Best Regards
Schroter Michael


----------



## cbbg (Jun 2, 2022)

Hi, I ran into the same issue. I solved it by installing libzmq using pkg and reinstalling the pyzmq library. This prevents pyzmq compiling its own version of libzmq if it is not found on the system.

`pkg install libzmq4
pip install --upgrade --no-deps --force-reinstall --no-binary pyzmq pyzmq`


----------



## hbsd (Jun 2, 2022)

Schroter said:


> Hi, Thanks for the reply. I do not want to install python packages in a global environment. I think its safer and prefer the environments separate.


Hi, to solve this problem you can use jail(8).


----------

