# Install Python in Bitnami

**URL:** <https://community.dreamfactory.com/t/install-python-in-bitnami/3962>\
**Category:** Server-Side Scripting\
**Created:** [July 24, 2017, 4:00pm UTC](https://community.dreamfactory.com/t/install-python-in-bitnami/3962 "2017-07-24T16:00:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Tissier](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@Julien\_Tissier](https://community.dreamfactory.com/u/Julien_Tissier)\
**Post date:** [July 24, 2017, 4:00pm UTC](https://community.dreamfactory.com/t/install-python-in-bitnami/3962/1 "2017-07-24T16:00:34Z")

</div>

Hello all,

I’m using Bitnami Dreamfactory 2.3.1-0 and I tried to use the Math service in Python given in the example scripts but I always have the same error

> {  
> “error”: {  
> “context”: null,  
> “message”: “Executed command returned with error code: 1”,  
> “code”: 500  
> }  
> }

I tried to edit the .env file

> DF\_PYTHON\_PATH=C:\PROGRA~1\Python36\python.exe

and reload the environment with the command

> php artisan dreamfactory:setup

but I still have the 500 error with trace array… Did I miss something ?

---

<div class="post-metadata">

**Author:** ![mattschaer](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/mattschaer/32/914_2.png) [@mattschaer](https://community.dreamfactory.com/u/mattschaer)\
**Post date:** [July 26, 2017, 4:00pm UTC](https://community.dreamfactory.com/t/install-python-in-bitnami/3962/2 "2017-07-26T16:00:32Z")

</div>

@Julien_Tissier After you edit the .env file, run `../../../php/php artisan config:clear` to clear the cached config and `../../../php/php artisan cache:clear` . The `php artisan dreamfactory:setup` command is only used when setting up the DF environment.

It’s also important to note that if you intend to use Python for scripting you will need to install the ‘bunch’ module `pip install bunch`

---

<div class="post-metadata">

**Author:** ![Julien\_Tissier](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@Julien\_Tissier](https://community.dreamfactory.com/u/Julien_Tissier)\
**Post date:** [July 26, 2017, 4:53pm UTC](https://community.dreamfactory.com/t/install-python-in-bitnami/3962/3 "2017-07-26T16:53:18Z")

</div>

Hello, thanks for you answer

I already did everything (see below), I redo it but still have the error.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/dreamfactory/original/2X/9/9aba42d4260cf609ba4c44055067af15c519783d.png)

---

<div class="post-metadata">

**Author:** ![Julien\_Tissier](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@Julien\_Tissier](https://community.dreamfactory.com/u/Julien_Tissier)\
**Post date:** [July 31, 2017, 9:49am UTC](https://community.dreamfactory.com/t/install-python-in-bitnami/3962/5 "2017-07-31T09:49:50Z")

</div>

I finally resolved my issue !

It seems Dreamfactory only supports Python 2 and I had 3.6 version

I launched the service.math python script directly in cmd and I got the error “ImportError: No module named httplib”

This error means I am running Python 2 code on Python 3. In Python 3, the module has been renamed to http.client.

Then I removed Python 3.6 and added python 2.7, updated the .env file, launched artisan commands and tested my python script and… I got a new error !

It appeats the script given (in [https://wiki.dreamfactory.com/DreamFactory/Features/Scripting/Python](https://wiki.dreamfactory.com/DreamFactory/Features/Scripting/Python) and [https://wiki.dreamfactory.com/DreamFactory/Tutorials/Python\_Custom\_scripting\_service\_math](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Python_Custom_scripting_service_math)) uses em-dash in a comment.

But when you save the script, the em-dash is saved as an encoded character and everybody know Python 2.7 has encoding issues (sorry I can not display a second picture)…

So I resolved my problem but please, if someone can update links given above and tell users they need python 2 and remove the em-dash in examples !
