# How to install Brian 1

**URL:** <https://brian.discourse.group/t/how-to-install-brian-1/243>\
**Category:** Support\
**Tags:** brian1\
**Created:** [2 January 2021 09:03 UTC](https://brian.discourse.group/t/how-to-install-brian-1/243 "2021-01-02T09:03:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ziaeemehr](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/ziaeemehr/32/12_2.png) [@Ziaeemehr](https://brian.discourse.group/u/Ziaeemehr)\
**Post date:** [2 January 2021 09:03 UTC](https://brian.discourse.group/t/how-to-install-brian-1/243/1 "2021-01-02T09:03:17Z")

</div>

I often encounter codes in Brian 1 that usually take too much time for converting to Brian 2 and some times I fail to reproduce the original results. I tried to install Brian 1 but I get many errors for inconsistency of package dependency.

Could you please guide?  
I use an environment for Python 2 and install all the packages.  
Just a guess:  
I think if there is a `requirement.txt` file with valid version of dependency package `== > < v ?.?` solve many issues.

best,

```auto
$ cd brian-1.4.4
$ pip install -e .

Error initializing plugin EntryPoint(name='Windows (alt)', value='keyrings.alt.Windows', group='keyring.backends').
Traceback (most recent call last):
  File "/home/abolfazl/.local/lib/python3.6/site-packages/keyring/backend.py", line 198, in _load_plugins
    init_func = ep.load()
  File "/usr/local/lib/python3.6/dist-packages/importlib_metadata/ __init__.py", line 95, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.6/importlib/ __init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/keyrings/alt/Windows.py", line 9, in <module>
    from . import file_base
  File "/usr/lib/python3/dist-packages/keyrings/alt/file_base.py", line 13, in <module>
    from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Error initializing plugin EntryPoint(name='file', value='keyrings.alt.file', group='keyring.backends').
Traceback (most recent call last):
  File "/home/abolfazl/.local/lib/python3.6/site-packages/keyring/backend.py", line 198, in _load_plugins
    init_func = ep.load()
  File "/usr/local/lib/python3.6/dist-packages/importlib_metadata/ __init__.py", line 95, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.6/importlib/ __init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/keyrings/alt/file.py", line 11, in <module>
    from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Error initializing plugin EntryPoint(name='pyfs', value='keyrings.alt.pyfs', group='keyring.backends').
Traceback (most recent call last):
  File "/home/abolfazl/.local/lib/python3.6/site-packages/keyring/backend.py", line 198, in _load_plugins
    init_func = ep.load()
  File "/usr/local/lib/python3.6/dist-packages/importlib_metadata/ __init__.py", line 95, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.6/importlib/ __init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/keyrings/alt/pyfs.py", line 8, in <module>
    from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/abolfazl/Desktop/whatch%20later/akam2010/Python2_env/brian-1.4.4
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/setup.py'"'"'; __file__ ='"'"'/home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)( __file__ );code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__ , '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-1wolw5nj
         cwd: /home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/setup.py", line 31
        except CCompilerError, ex:
                             ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!

```

Update:

```auto
pip install --upgrade keyrings.alt

```

```auto
$ pip install -e . 
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/abolfazl/Desktop/whatch%20later/akam2010/Python2_env/brian-1.4.4
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/setup.py'"'"'; __file__ ='"'"'/home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)( __file__ );code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__ , '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-xlk8j73v
         cwd: /home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/abolfazl/Desktop/whatch later/akam2010/Python2_env/brian-1.4.4/setup.py", line 31
        except CCompilerError, ex:
                             ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

```

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [4 January 2021 10:52 UTC](https://brian.discourse.group/t/how-to-install-brian-1/243/2 "2021-01-04T10:52:16Z")

</div>

Hi. I will look into preparing some kind of frozen requirements file for Brian 1 (or maybe a container). In general, the minimal requirements should work (i.e. Python 2.7 with numpy 1.4.1, scipy 0.7.0 and sympy 0.7.1).

In your specific case, the issue is not coming directly from Brian: you are using a Python 2 environment, but somehow it picks up a local Python 3 installation of the `keyring` package (in `~/.local/lib/python3.6/site-packages/keyring/`) – maybe this directory is manually set via `PYTHONPATH`? It might also simply be that your Python 2 environment does not have `pip` installed and so it picks up a Python 3 pip from elsewhere. A good habit is to use `python -m pip install` instead of `pip install` to make sure that the `pip` tied to the current Python interpreter is used.

---

<div class="post-metadata">

**Author:** ![Ziaeemehr](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/ziaeemehr/32/12_2.png) [@Ziaeemehr](https://brian.discourse.group/u/Ziaeemehr)\
**Post date:** [4 January 2021 10:58 UTC](https://brian.discourse.group/t/how-to-install-brian-1/243/3 "2021-01-04T10:58:55Z")

</div>

Thank you, The error from `keyring` resolved after this:

> [@Ziaeemehr](#):
>
> `pip install --upgrade keyrings.alt`

The Brian 1 container would be great.

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [4 January 2021 11:01 UTC](https://brian.discourse.group/t/how-to-install-brian-1/243/4 "2021-01-04T11:01:02Z")

</div>

> [@Ziaeemehr](#):
>
> Thank you, The error from `keyring` resolved after this:

Oh sorry, I did not see this.  
But it still uses Python 3 which is the reason for the error:

```auto
command: /usr/bin/python3 -c ...

```

It might just be an issue of using the wrong `pip`.

---

<div class="post-metadata">

**Author:** ![Ziaeemehr](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/ziaeemehr/32/12_2.png) [@Ziaeemehr](https://brian.discourse.group/u/Ziaeemehr)\
**Post date:** [4 January 2021 11:40 UTC](https://brian.discourse.group/t/how-to-install-brian-1/243/5 "2021-01-04T11:40:33Z")

</div>

It resolved the error. Just I had some error importing scipy 0.8.0, but scipy 0.9.0 worked.  
Thank you 🙂  
best,
