User Tools

Site Tools


python_install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
python_install [2019/02/02 16:58] – [Troubleshooting] g00r00python_install [2019/03/10 09:18] – [Troubleshooting] g00r00
Line 3: Line 3:
 ===== Installation and Requirements ===== ===== Installation and Requirements =====
  
-Mystic requires that Python 2.7 is installed on your system if you wish to execute Python scripts.  The presence of Python is detected automatically by Mystic, and is initialized as needed.  It is not in any way a dependency and Mystic will continue to operate normally without it should you decide you do not wish to use it. +Mystic BBS has an embedded Python scripting engine called Mystic Python.  This engine is based on Python 2.7 and is compatible with all Python 2.7 code and modules.  In order for this to function properly, Mystic requires that Python 2.7 is installed on the operating system.  Python is not a dependency for Mystic to function, so if you do not plan to execute Python scripts then you do not need to have Python installed if you do not wish to use it. 
-   + 
-Most Linux desktop distributions and Apple's macOS will come with Python 2.7 installed by defaultand in many cases no installation will be required in order to use Python.  If not, it can typically be installed by a package manager in Unix (explained below).  In Windows, Python needs to be installed by downloading it from the Website: [[http://www.python.org|www.python.org]]+**Note:** The "bit level" of Python must match the "bit level" of Mysticso if you are using a 32-bit version of Mystic you should install the 32-bit version of Python.  If you are using the 64-bit version of Mystic you should install the 64-bit version of Python.  Be particularly careful when selecting your installation download in Windows! 
 + 
 +In Windows, Python needs to be installed by downloading it from the Website:[[http://www.python.org|www.python.org]] 
 + 
 +Most Linux desktop distributions and MacOS will come with Python 2.7 installed by default, and in some cases full Mystic Python functionality will work out of the box without additional steps.  However some of the more popular installations such as Ubuntu and Mint Linux do not come with Python installed with shared libraries enabled, which means it will not work with embedded Python applications like Mystic.
  
-**Note:** If you are using the 32-bit version of Mystic (even if it is in 64-bit operating system), then you need the 32-bit version of Python installed.  If you are using the 64-bit version of Mystic then you need to have the 64-bit version of Python installed.  This is a very common mistake, particularly on the Windows platform where SysOps will download the wrong bit-version of Python.+If you are using a Linux operating system with this issue then modules such as "sqlite3" will fail when they are included in a script with an error mentioning Py_ZeroStruct.  In order to fix this issue, a new Python will have to be compiled in a way that is compatible with Mystic.  See the Troubleshooting section below for steps to compile and install Python properly.
  
 ==== Library Validation / Installation ==== ==== Library Validation / Installation ====
Line 89: Line 93:
  
 The most common Windows issue is that the wrong version of Python is installed.  It is absolutely a requirement that you download the 32-bit version of Python if using 32-bit version of Mystic, and the 64-bit version of Python if using the 64-bit version of Mystic. The most common Windows issue is that the wrong version of Python is installed.  It is absolutely a requirement that you download the 32-bit version of Python if using 32-bit version of Mystic, and the 64-bit version of Python if using the 64-bit version of Mystic.
 +
 +If you get an error similar to "“Importerror: No module named site" when your script tries to import a module, this
 +means you need to set your Python environment variables.  See the section above for information and an example of
 +how to do this in Windows.
  
 === Unix === === Unix ===
Line 101: Line 109:
 for embedded applications, and also the unicode size may need to be either ucs2 or ucs4. for embedded applications, and also the unicode size may need to be either ucs2 or ucs4.
  
-The following steps can be used to reinstall Python 2.7 on Ubuntu 18.04 LTS:+The following steps can be used to reinstall Python 2.7 tested on a fresh Ubuntu 18.04 LTS:
  
 **INSTALL PREREQUISITES:** **INSTALL PREREQUISITES:**
Line 113: Line 121:
   * sudo tar xzf Python-2.7.15.tgz   * sudo tar xzf Python-2.7.15.tgz
   * cd /usr/src/Python-2.7.15   * cd /usr/src/Python-2.7.15
-  * sudo ./configure --enable-optimizations --enable-unicode=ucs4 --enable-shared+  * sudo ./configure -enable-optimizations -enable-unicode=ucs4 -enable-shared
   * sudo make install   * sudo make install
- 
-**CREATE LINK TO PYTHON:** 
-  * sudo ln -s /usr/local/bin/python2.7 /usr/bin/python 
  
python_install.txt · Last modified: 2023/01/08 12:24 by g00r00

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki