installation.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. .. _installation_section:
  2. ************
  3. Installation
  4. ************
  5. Overview
  6. ########
  7. This section describes the installation of the CellBlender bundle with MCell4.
  8. Please also follow the prerequisites.
  9. Additional installation steps are required to use MCell4 outside of Blender
  10. with Python 3.9 and they are described in section: :ref:`setting_system_variables`.
  11. Download
  12. ########
  13. CellBlender bundle containing MCell4 is available for download
  14. for different operating systems at the MCell.org website: `<https://mcell.org/download.html>`_.
  15. Installation
  16. ############
  17. MacOS
  18. *****
  19. After downloading, the zip file will be automatically extracted to your downloads directory.
  20. Move the Blender-2.93-CellBlender directory to Applications (i.e., to the directory /Applications).
  21. The CellBlender bundle won't work correctly in any other directory.
  22. MCell4 build is known to work also on the latest Apple MacBooks with ARM processor M1.
  23. MacOS Mojave and Older
  24. ----------------------
  25. If you have an older version of MacOS than the Catalina MacOS, you can skip
  26. to the following section `Running Blender On MacOS`_. The following setup is not needed and the only
  27. thing required is that the unpacked bundle is under the directory /Applications.
  28. Start Blender by double-clicking the blender application file.
  29. .. image:: images/installation_macos_start_blender.png
  30. Although the package is digitally signed, some newer MacOS versions require extra approvals from Apple,
  31. for now, you will most probably get one of the following warnings:
  32. .. image:: images/installation_macos_warning1.png
  33. .. image:: images/installation_macos_warning2.png
  34. Click on **Cancel** or on **OK** and then open System Preferences (through the Apple menu in the top left).
  35. Select Security and Privacy.
  36. .. image:: images/installation_macos_security_and_privacy.png
  37. In the Security & Privacy settings, click on **Open Anyway**.
  38. .. image:: images/installation_macos_security_and_privacy_selected.png
  39. One more warning appears; select **Open**.
  40. .. image:: images/installation_macos_warning3.png
  41. .. image:: images/installation_macos_warning4.png
  42. Now quit Blender and start it from the terminal, as shown in the following section.
  43. This will allow you to see additional messages printed by CellBlender.
  44. It also allows one to overcome a settings saving issue on MacOS Catalina (described in section 2.2).
  45. Running Blender On MacOS
  46. ------------------------
  47. Open a terminal window; terminal can be found under Applications and Utilities.
  48. .. image:: images/installation_macos_start_terminal.png
  49. Run the following commands from the terminal:
  50. .. code-block:: text
  51. cd /
  52. /Applications/Blender-2.93-CellBlender/my_blender
  53. By now, CellBlender should be up and running; however, if you get a message that the application
  54. is damaged, please see section `Common Troubleshooting`_.
  55. Linux
  56. *****
  57. Unpacking the CellBlender Package
  58. ---------------------------------
  59. Start a terminal window and run the following command where <path_to_bundle.tar.gz> is the path
  60. where you downloaded the CellBlender bundle and <target_directory> is the desired installation directory:
  61. .. code-block:: text
  62. tar -xf <path_to_bundle.tar.gz> -C <target_directory>
  63. Running Blender on Linux
  64. ------------------------
  65. From a terminal, run the following command:
  66. .. code-block:: text
  67. <target_directory>/Blender-2.93-CellBlender/my_blender
  68. Windows
  69. *******
  70. Installing Strawberry Perl
  71. --------------------------
  72. Interpreter of the Perl programming language is not usually present on Windows,
  73. so one needs to install it before using CellBlender when importing BNGL files into CellBlender or
  74. when using MCell3R. Perl is not needed to run MCell4.
  75. From `<http://strawberryperl.com/>`_, download the 64-bit variant (strawberry-perl-5.30.2.1-64bit.msi)
  76. and install it.
  77. If you have any troubles installing it, please follow the parts related to Strawberry Perl here:
  78. `<https://mcell.org/downloads/windows/install_2019_05/index.html>`_.
  79. Installing Microsoft Visual C++ 2015 Redistributable Update 3 RC
  80. ----------------------------------------------------------------
  81. Python requires windows library VCRUNTIME140.DLL to be present under C:\windows\system32\.
  82. To install it, download file vc_redist_x64.exe from here and install it:
  83. `<https://www.microsoft.com/en-us/download/details.aspx?id=52685>`_.
  84. .. image:: images/installation_win_redist.png
  85. Unpacking the CellBlender Archive
  86. ---------------------------------
  87. Find the file Blender-2.93-CellBlender-<version>-Windows-<date>.tar.gz in
  88. Explorer, right-click and select *Extract here*.
  89. Running Blender on Windows
  90. --------------------------
  91. Start Windows terminal (click on Start, then type cmd, then enter).
  92. Then run the following command where <target_directory> is the directory
  93. to which you unpacked CellBlender:
  94. .. code-block:: text
  95. <target_directory>\Blender-2.93-CellBlender\blender.exe
  96. .. _setting_system_variables:
  97. Setting System Variable MCELL_PATH and adding Python 3.9 to PATH
  98. ################################################################
  99. MCell4 Python models use the system variable *MCELL_PATH* to locate
  100. the MCell4 library. It is also useful as a shortcut to the location of utility scripts
  101. contained in the CellBlender bundle.
  102. MCell4 also requires Python 3.9. You can either use you own installation or set
  103. the system variable *PATH* so that the Python included in the CellBlender bundle is found.
  104. The models generated by CellBlender expect a system variable *MCELL_PATH* to
  105. be defined and use it to add this path (appended with 'lib') to the
  106. Python's search paths like this:
  107. .. code-block:: python
  108. MCELL_PATH = os.environ.get('MCELL_PATH', '')
  109. sys.path.append(os.path.join(MCELL_PATH, 'lib'))
  110. import mcell as m
  111. One can also use the standard system variable
  112. `PYTHONPATH <https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH>`_
  113. for the same purpose, but the CellBlender tools use the *MCELL_PATH* variable.
  114. MacOS
  115. *****
  116. Open the file *~/.bash_profile* in your text editor - e.g. *atom ~/.bash_profile*
  117. and append the following lines to the end of the file:
  118. .. code-block:: text
  119. export CELLBLENDER_BASE_PATH=/Applications/Blender-2.93-CellBlender/blender.app/Contents/Resources/2.93/
  120. export MCELL_PATH=$CELLBLENDER_BASE_PATH/scripts/addons/cellblender/extensions/mcell/
  121. export PATH=$PATH:$CELLBLENDER_BASE_PATH/python/bin/
  122. You must open a new terminal for this change to take effect.
  123. Linux
  124. *****
  125. Open the file *~/.bashrc* in your text editor - e.g. *gedit ~/.bashrc*
  126. and append the following line to the end of the file
  127. (replace *<blender_dir>* with the CellBlender bundle installation directory).
  128. .. code-block:: text
  129. export CELLBLENDER_BASE_PATH=<blender_dir>/2.93/
  130. export MCELL_PATH=$CELLBLENDER_BASE_PATH/scripts/addons/cellblender/extensions/mcell/
  131. export PATH=$PATH:$CELLBLENDER_BASE_PATH/python/bin/
  132. You must open a new terminal for this change to take effect.
  133. Windows
  134. *******
  135. Go to the Windows menu, right-click on *Computer* (write *computer* to find it) and select *Properties*.
  136. From the computer properties dialog, select *Advanced system settings* on the left.
  137. From the advanced system settings dialog, choose the *Environment variables* button.
  138. In the Environment variables dialog, click the *New* button in the top half of the dialog
  139. to make a new user variable. Give the variable name as MCELL_PATH and the value is the following path
  140. (replace *<blender_dir>* with the CellBlender bundle installation directory):
  141. .. code-block:: text
  142. <blender_dir>\2.93\scripts\addons\cellblender\extensions\mcell\
  143. Choose OK.
  144. Then find a variable called *PATH* or *Path* in one of the
  145. the user's variables or in the system variables.
  146. Select it, click *Edit* and then *New* and as the new line enter
  147. (replace *<blender_dir>* with the CellBlender bundle installation directory):
  148. .. code-block:: text
  149. <blender_dir>\2.93\python\bin\
  150. Choose OK.
  151. Then OK again to save these variables.
  152. You must open a new terminal for this change to take effect.
  153. Common Troubleshooting
  154. ######################
  155. Loading Factory Settings
  156. ************************
  157. Blender keeps setting in a user directory, so settings from a previous installation might
  158. be loaded and cause various incompatibility issues.
  159. If you encounter any issues with CellBlender, the first recommended step is to reset settings.
  160. It is done through Blender menu *File* -> *Load Factory Settings*.
  161. Enabling CellBlender Plugin
  162. ***************************
  163. After factory setting are restored, one needs enable the CellBlender plugin by
  164. selecting *Edit* -> *Preferences*, then select *Add-ons*, enter *cellblender*
  165. into the search window and click on the CellBlender checkbox.
  166. .. image:: images/plugin_cellblender_enable.png
  167. CellBlender Plugin Does not Load with "error cellblender_examples could not register"
  168. *************************************************************************************
  169. This was experienced on MacOS and one of the printed errors was:
  170. .. code-block:: text
  171. ValueError: bpy_struct "MCellPropertyGroup" registration error: cellblender_examples could not register
  172. .. image:: images/troubleshooting_cannot_initialize_cellblender.png
  173. The solution is to follow steps in `Loading Factory Settings`_ or to remove file
  174. */Applications/Blender-2.93-Cellblender/blender.app/Contents/Resources/2.93/config/userpref.blend*
  175. (*<blender_dir>/Blender-2.93-CellBlender/2.93/config/userpref.blend* on other operating systems).
  176. Then start Blender again and enable the CellBlender plugin.
  177. MacOS: Error When Saving CellBlender Settings
  178. *********************************************
  179. When saving settings an error "cannot open file /private/var/.../blender.app/Contents/Resources/..."
  180. can be printed.
  181. On MacOS Catalina and newer, the area where Blender stores its settings is protected.
  182. The first step is to try to run Blender from a terminal as shown in section `Running Blender On MacOS`_,
  183. i.e., by running this script:
  184. .. code-block:: text
  185. /Applications/Blender-2.93-CellBlender/my_blender
  186. Then try to save the setting again. If that won't help, continue with setting permissions for
  187. terminal to access all folders as shown `here <https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/>`_.
  188. MacOS: Remove "application downloaded from internet" Attribute
  189. **************************************************************
  190. This step might be useful for releases older than 3.5.0 on MacOs Catalina.
  191. The *xattr* command can be used to remove the 'application downloaded from the internet' error message.
  192. This can, for instance, be an issue on MacOS Catalina where the checking is more strict. To fix this, run:
  193. .. code-block:: text
  194. xattr -cr /Applications/Blender-2.93-CellBlender/blender.app
  195. Windows: Plotting does not work
  196. *******************************
  197. There might be a collision with a different installation of Python on your system.
  198. To fix this, start the Windows terminal, navigate to the Blender-2.93-CellBlender directory,
  199. and then run these commands to start CellBlender:
  200. .. code-block:: text
  201. set PYTHONPATH=
  202. blender.exe