picamera icon indicating copy to clipboard operation
picamera copied to clipboard

Install picamera on other devices

Open Esser50K opened this issue 7 years ago • 4 comments

It would be nice to be able to install picamera on regular windows and Mac systems. I know it won't be capable of doing anything there but at least one would be able to run tests where the module is then mocked.

Esser50K avatar Jan 07 '19 22:01 Esser50K

@LizardM4 commented the same on another issue. https://github.com/waveform80/picamera/issues/404#issuecomment-332461857

I found your issues while looking for a solution to this myself.

Warning: picamera only works on raspberry pi systems. This solution allows you to install picamera on a different OS so you can use the library for code completion in your IDE. The library will however be nonfunctional.

Optional: If you are using Python venv (Virtual Environment) first activate your environment by opening a terminal and executing the activate or activate.bat

On Windows, execute: set READTHEDOCS=True On Unix based systems, execute: export READTHEDOCS=True

Now execute: pip install picamera

The library should install without issues.

Optional: If you are using Python venv, you can exit your virtual environment by running deactivate

Flightkick avatar Mar 26 '19 13:03 Flightkick

worked

arpit7714 avatar Oct 10 '19 13:10 arpit7714

The problem is fixed and it is installed But I'm curious to know what it is and what it does. set READTHEDOCS=True Can you give an explanation?

mohammad3a1eh avatar Jan 16 '23 20:01 mohammad3a1eh

@kinite-gp Good question, had to look it up since it's been a while. Setting the variable to True skips the check which validates if the installation is running on a Raspbery Pi.

This is the relevant code for the latest release: https://github.com/waveform80/picamera/blob/e18d70989eb6c3bf19f4cea859c7401bea3b9048/setup.py#L97-L114

It seems that the current master branch doesn't contain this check anymore but the latest release (1.13) does.

Flightkick avatar Mar 02 '23 13:03 Flightkick