7
$\begingroup$

How can I go about getting pyserial installed under win7 64bit for Blenders bundled python distro?

I currently have python 2.7 installed for programming outside of blender, and have pyserial installed for that, but I'm trying to get serial data fed into blender which needs pyserial for 3.3.

When I try installing pyserial with the pyserial-2.7.win32_py3k.exe it doesn't find the python installation and I don't know how to point it to theBlender\2.69\python folder.

$\endgroup$

3 Answers 3

6
$\begingroup$

Answer: I don't think there is a way to point a Python module installer to the Blender bundled Python. So if you must use a third party Blender Python, there are generally 3 ways to go about that:

  • remove blender python sub-directory, blender will then fallback on the systems python and use that instead. Note that Python version must match the one that blender comes with.

  • Install a Python environment that's the same version as the bundled Blender Python to your system directory. (i.e. Python 3.3 64bit). Then install Pyserial (py3k) into that Python installation. Lastly copy the installed Pyserial module manually to the Blender Python installation under Blender\2.69\python. Installed Python modules can be usually found under the lib/site-package directory.

  • Most Python modules are just .py files that can be copies without going through a formal installation process. So, mostly likely, you can try to extract the module files from the installer, and just copy it straight to the Blender Python. This way, you don't have to keep a system Python just for installation purposes.

Non-answer: Do you really need to install it to the Blender Python? You can set up the PATH variable to basically load a module from any where on the disk.

$\endgroup$
1
0
$\begingroup$

I've found the solution to getting modules to install for Python 3.3, which will work in the blender python environment, while having Python 2.7 installed along side for separate programming projects.

The solution was simple - install Python 3.3 at C:\Python33 like a standard installation, then REMOVE every python related instance in the environment variables for Users and System, this includes PATH, PYTHONHOME, and PYTHONEVIRONMENT. Of course, you don't want to delete the PATH variable if it holds other data, but the other two can be completely deleted.

Now, when you download and install a Python 3.3 module, like PySerial, you install it just as you would if you were installing it to program outside of Blender. Now, if you want to check your installations of Python are still available to you, in a console, type py -2 or py -3 for the respective interpreters.

Now, with your 3.3 module installed, if you open a blender python window and type 'import serial', you'll get a good import and you can play with third party modules in Blender without a problem.

$\endgroup$
-2
$\begingroup$

First thing be sure that you have installed a 32 bits version of pyhton. I give you the link of python downloading website

If you have downloaded a win32 version of pyhton 2.7 and pyserial-2.7.win32_py3k.exe the installation should work.

If you want to try if the installation has worked, open a 2.7 python console and type:

import serial

If you have an error the installation of pyserial on python hasn't worked.

When you have installed you pyserial on pyhton 2.7 you have to install it on blender. First thing : be sure to have a 32 bits version of blender

Now you have to copy the serial folder and the pyserial-2.7 - py3.3.egg-info in the

C:\Python27\Lib\site-packages folder (python2.7 folder)

and past this folder and file in your blender folder

C:\Program Files (x86)\Blender Foundation\Blender\2.69\scripts\modules

Now your installation of pyserial on blender is done.

$\endgroup$
2
  • $\begingroup$ Your mixing up versions - the pyserial is at 2.7 but the python version would need to be 3.3 and your showing the python 2.7 path. $\endgroup$
    – sambler
    Commented Dec 9, 2013 at 9:53
  • $\begingroup$ Actually it has worked like that for me so. Probablly this pyserial is for python 3.3 and below. $\endgroup$
    – lucblender
    Commented Dec 9, 2013 at 9:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .