Skip to content

Commit

Permalink
fix 2023-12-05-x86_64-binaries-on-m1.md
Browse files Browse the repository at this point in the history
  • Loading branch information
isotopp committed Dec 6, 2023
1 parent 05be38e commit afdd85a
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions content/posts/2023-12-05-x86_64-binaries-on-m1.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,20 @@ $ which python
/Users/kris/.pyenv/shims/python
```

Now the global installation of `virtualenv` into our Python 2.7.18 instance:
Now the installation of `virtualenv` into our Python 2.7.18 instance:

```console
$ pip --version
pip 19.2.3 from /Users/kris/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)
$ pip install virtualenv
$ pip install --user virtualenv
...
```

We now can call the old version of `virtualenv` from our Python 2.7.18 installation directory:
We now can call this version of `virtualenv` for installation:

```console
$ ~/.pyenv/versions/2.7.18/bin/virtualenv venv
$ cd archaeology
$ ~/.local/bin/virtualenv venv
created virtual environment CPython2.7.18.final.0-64 in 102ms
...
$ source venv/bin/activate
Expand Down Expand Up @@ -165,3 +166,28 @@ Successfully installed cx-Oracle-7.3.0

Note that this will still need an `ORA_HOME` pointing to your instantclient directory,
and the `dylib` files linked from the Python libdir to the instantclient installation.

So:

```
$ ORA_HOME=~/instantclient*
$ echo "export ORA_HOME=$ORA_HOME" >> ~/.bash_profile
$ cd ~/.pyenv/versions/2.7.18/lib
$ for i in ~/instantclient*/*.dylib*;
> do
> echo $i;
> ln -s $i .
> done
```

With the proper `~/instantclient*/network/admin/TNSNAMES.ORA` you can now

```
(venv) $ python2
...
>>> import cx_Oracle
>>> c = cx_Oracle.Connection("sys", "oracle", "ORCL")
>>> c
<cx_Oracle.Connection to sys@ORCL>
```

0 comments on commit afdd85a

Please sign in to comment.