# Cannot install Nuba on FreeBSD 13



## Schroter (May 4, 2021)

Hi, I have managed create a python virtual environment in python and would like to install numba package in it.
Please refer the code below.


```
(tutorial-env) michael@MS:~ % pip install numba
Collecting numba
  Using cached numba-0.53.1.tar.gz (2.2 MB)
Collecting llvmlite<0.37,>=0.36.0rc1
  Using cached llvmlite-0.36.0.tar.gz (126 kB)
Requirement already satisfied: numpy>=1.15 in ./tutorial-env/lib/python3.9/site-packages (from numba) (1.20.2)
Requirement already satisfied: setuptools in ./tutorial-env/lib/python3.9/site-packages (from numba) (56.0.0)
Building wheels for collected packages: numba, llvmlite
  Building wheel for numba (setup.py) ... done
  Created wheel for numba: filename=numba-0.53.1-cp39-cp39-freebsd_13_0_release_amd64.whl size=2285629 sha256=7a5a68a146c30fe6bee9f25fda4c2c16ac9be92b4dee46951c9495e508dd9970
  Stored in directory: /usr/home/michael/.cache/pip/wheels/86/ae/01/9c7c22acf1131e3a439113c0d2f67bc98caa5183b7a367f528
  Building wheel for llvmlite (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/home/michael/tutorial-env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-b2xnvfbo
       cwd: /tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/
  Complete output (11 lines):
  running bdist_wheel
  /usr/home/michael/tutorial-env/bin/python /tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py", line 220, in <module>
      main()
    File "/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py", line 212, in main
      main_posix('freebsd', '.so')
    File "/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py", line 134, in main_posix
      raise RuntimeError(msg) from None
  RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
  error: command '/usr/home/michael/tutorial-env/bin/python' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Successfully built numba
Failed to build llvmlite
Installing collected packages: llvmlite, numba
    Running setup.py install for llvmlite ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/home/michael/tutorial-env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-t9nfscca/install-record.txt --single-version-externally-managed --compile --install-headers /usr/home/michael/tutorial-env/include/site/python3.9/llvmlite
         cwd: /tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/
    Complete output (14 lines):
    running install
    running build
    got version from file /tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/llvmlite/_version.py {'version': '0.36.0', 'full': 'e6bb8d137d922bec8beeb01a237254778759becd'}
    running build_ext
    /usr/home/michael/tutorial-env/bin/python /tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py", line 220, in <module>
        main()
      File "/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py", line 212, in main
        main_posix('freebsd', '.so')
      File "/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/ffi/build.py", line 134, in main_posix
        raise RuntimeError(msg) from None
    RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
    error: command '/usr/home/michael/tutorial-env/bin/python' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/home/michael/tutorial-env/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q3inh1z1/llvmlite_225f84bdefcf449bbe2d50134c513eeb/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-t9nfscca/install-record.txt --single-version-externally-managed --compile --install-headers /usr/home/michael/tutorial-env/include/site/python3.9/llvmlite Check the logs for full command output.
```

Would anyone please be able to help me in this matter?

Thanks & Best Regards

Michael


----------



## Jose (May 4, 2021)

Any reason why you're not using the package devel/py-numba?

You can find the person who wrote that port having the exact same problem on these forums








						Solved - Require LLVM_CONFIG variable in port
					

Hello,  I am looking at porting over llvmlite, and numba for python. It builds just fine with the documentation provided, however it is required to pass LLVM_CONFIG: LLVM_CONFIG=/usr/local/bin/llvm-config37 python setup.py  Which works fine as an install for myself. However as a port, I wasn't...




					forums.freebsd.org
				




Try `LLVM_CONFIG=/usr/local/bin/llvm-config10 pip install numba` if you insist on using pip.

Your version of `llvm-config` is probably different. I'm on Freebsd 12.2.


----------



## Schroter (May 4, 2021)

Jose said:


> Any reason why you're not using the package devel/py-numba?
> 
> You can find the person who wrote that port having the exact same problem on these forums
> 
> ...


Hi, thanks for the reply. I am trying install it in a python virtual environment and my python version is 3.9.4. Furthermore, I have trouble installing opencv-python the same way. It gives a massive error and at the end says:

```
ERROR: Could not build wheels for cmake which use PEP 517 and cannot be installed directly
```


Thanks & Best Regards
Michael


----------



## Jose (May 4, 2021)

You're welcome. The Opencv port, graphics/opencv installs the Python bindings by default.


----------



## SirDice (May 4, 2021)

Michael_S said:


> and my python version is 3.9.4.


If you set `DEFAULT_VERSIONS= python3=3.9 python=3.9` and build the Python modules from ports it will use that setting as the default Python version. See /usr/ports/Mk/bsd.default-versions.mk.

Many packages are also available in different python "flavors", i.e. `pkg install py39-numba` to get the specific Python 3.9 version.


----------



## Schroter (Sep 1, 2021)

Hi All,

I have another issue. I have installed `python3.9` on FreeBSD 13 I am trying install some python packages in a virtual environment. However, when installing it hangs when trying to install `wheel`. When I was installing `pip` I got a warning saying include `/home/schroter/.local/bin` in path. So I did. 
Now my path (~/.cshrc file) looks like:
`/home/schroter/pythonVE/analyticsVE/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/schroter/bin:/usr/home/schroter/julia-1.6.2/bin:/usr/home/schroter/.local/bin`
Would anyone please be able to help me in this regards?
Thanks & Best Regards
Schroter


----------



## Schroter (Sep 1, 2021)

Schroter said:


> Hi All,
> 
> I have another issue. I have installed `python3.9` on FreeBSD 13 I am trying install some python packages in a virtual environment. However, when installing it hangs when trying to install `wheel`. When I was installing `pip` I got a warning saying include `/home/schroter/.local/bin` in path. So I did.
> Now my path (~/.cshrc file) looks like:
> ...


Hi, guys it worked. Had to wait a while.. Not sure why it took a while. (around 15min)
Thanks & Best Regards
Schroter


----------



## Schroter (Sep 4, 2021)

SirDice said:


> If you set `DEFAULT_VERSIONS= python3=3.9 python=3.9` and build the Python modules from ports it will use that setting as the default Python version. See /usr/ports/Mk/bsd.default-versions.mk.
> 
> Many packages are also available in different python "flavors", i.e. `pkg install py39-numba` to get the specific Python 3.9 version.


Hi, would you be able to know whether this method work for a virtual environment as well? I want to use virtual environments since I do not want to clutter the OS with these modules and load only the modules that are needed at one time to increase performance.
Thanks & Best Regards
Schroter


----------



## Schroter (Sep 4, 2021)

Jose said:


> Any reason why you're not using the package devel/py-numba?
> 
> You can find the person who wrote that port having the exact same problem on these forums
> 
> ...


Hi, Thanks. It says on terminal :`LLVM_CONFIG=/usr/local/bin/llvm-config10: Command not found.`
Thanks & Best Regards
Schroter


----------

