Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Jun 23, 2023

Fixing chromadbd installation ERROR: Failed building wheel for hnswlib

When trying to install chromadb on a python environment, using

$ pip install chromadb

This error below might show up:

[...]

      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/pybind11/include -I/tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/numpy/core/include -I./hnswlib/ -I/home/p/Documents/dev/python/openai/include -I/usr/include/python3.10 -c ./python_bindings/bindings.cpp -o build/temp.linux-x86_64-cpython-310/./python_bindings/bindings.o -O3 -march=native -fopenmp -DVERSION_INFO=\"0.7.0\" -std=c++14 -fvisibility=hidden
      In file included from /tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/pybind11/include/pybind11/detail/../attr.h:13,
                       from /tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/pybind11/include/pybind11/detail/class.h:12,
                       from /tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/pybind11/include/pybind11/pybind11.h:13,
                       from /tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/pybind11/include/pybind11/functional.h:12,
                       from ./python_bindings/bindings.cpp:2:
      /tmp/pip-build-env-lorq5gen/overlay/lib/python3.10/site-packages/pybind11/include/pybind11/detail/../detail/common.h:266:10: fatal error: Python.h: No such file or directory
        266 | #include 
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for hnswlib
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects

On a Linux system the solution to fix the error above is to install 2 missing libraries:

$ sudo apt install python3-dev
$ sudo apt-get install build-essential -y






May 31, 2023

Jan 6, 2023

Installing Python with multiple environments


Step 1:


Step 2:

setup a directory to install Python via the command line
"mkdir python3ver" for the python binaries
and "mkdir pythonProjects" for the python projects

Step 3:

during the installation 
setup the install folder to python3ver\py3111\
then press 'install'

step 4:


via the command line go to pythonProjects
then type
python -m venv my_new_env

once it is done
tree my_new_env
to see the result

Step 5:

To activate the environment
Inside the PythonProjects folder
type
My_new_env\Scripts\activate

the prompt then will change showing (My_new_env)
from there Python can be launched.



To deactivate the environment
just type 'deactivate'

that's the end of the video




Sep 3, 2020

How to use COBE with Python 3.8

After installing Cobe - see previous post entry

here is an example of what you can do:

$ python3
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cobe.brain
>>> cobe.brain.Brain.init('test.brain')
>>> test=cobe.brain.Brain('test.brain')
>>> test.learn('this is a test!')
>>> print(test.reply('what is this?'))
this is a test!
>>>
 


basically talking with an AI 

...and training this AI while discussing

pretty cool

Sep 2, 2020

Installing Markov COBE on Windows 10

Cobe is a nifty python module Markov chain based text generation library and MegaHAL style chatbot 

the Linux installation is a breeze (easy as pie)

but on Windows 10 it is a bit tricky

Assuming you are using MINGW32 as environment for your python development - here is what needs to be done:

> git clone https://github.com/pteichman/cobe.git
> winpty python setup.py install
> pip install cython
> winpty python -m pip install --upgrade pip
> python -m pip install -U pip setuptools 

from this point all the items needed are installed 

Next step requires the installation of VisualStudio (vs2019 modules) https://visualstudio.microsoft.com)
Once the installer is downloaded use the 2 first options

And after this is done 

go to your cobe installation directory and finalize the install

> winpty python setup.py install

 

 

 

Jun 4, 2020

Minimal Python and git installation for Windows 10 Home edition

The purpose here is to get a super light python development platform

Fits for lightweight PC running Windows 10 Home - with less than 4GB of Ram


Popular Posts