linux python3 virtualenv

1,118 views
Skip to first unread message

Nicky Perian

unread,
Aug 18, 2021, 8:24:31 PM8/18/21
to OpenSource Mailing List
I have errors and when I open python and manually import setuptools this happens.

>>> import io
>>> import os
>>> import sys
>>> import setuptools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nicky/WORKON_HOME/autobuild-2.0.0/lib/python3.9/site-packages/setuptools/__init__.py", line 18, in <module>
    from setuptools.dist import Distribution
  File "/home/nicky/WORKON_HOME/autobuild-2.0.0/lib/python3.9/site-packages/_virtualenv.py", line 89, in exec_module
    old(module)
  File "/home/nicky/WORKON_HOME/autobuild-2.0.0/lib/python3.9/site-packages/setuptools/dist.py", line 38, in <module>
    from setuptools import windows_support
  File "/home/nicky/WORKON_HOME/autobuild-2.0.0/lib/python3.9/site-packages/setuptools/windows_support.py", line 2, in <module>
    import ctypes
  File "/usr/local/lib/python3.9/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

Fairly sure I am missing something Cpython is on the system and in the path.

Need help.

Monty Brandenberg

unread,
Aug 19, 2021, 3:30:38 AM8/19/21
to opensou...@lists.secondlife.com
On 8/18/2021 8:24 PM, Nicky Perian wrote:
> Fairly sure I am missing something Cpython is on the system and in the path.
>
> Need help.

_ctypes is provided by .so in a standard install. By the looks of
your stacktrace, you should see it in
/usr/local/lib/python3.9/lib-dynload/ as _ctypes.so and
_ctypes.cpython-39.so

Check if those are present. If not, you have an installation issue.
If present, you may have to dig a bit. Could be env vars sending
python to the wrong places.


Coyot Linden (Glenn Glazer)

unread,
Aug 19, 2021, 12:23:06 PM8/19/21
to opensou...@lists.secondlife.com
--
Archives of earlier incarnations of this list are at https://list-archives.secondlife.com
---
You received this message because you are subscribed to the Google Groups "opensource-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opensource-de...@lists.secondlife.com.
To view this discussion on the web visit https://groups.google.com/a/lists.secondlife.com/d/msgid/opensource-dev/CAF34W%3DEwc-tLXFUwUgjebg1AnacMhvX%2BUt02nCudkBwTM_UGLA%40mail.gmail.com.

Nicky Perian

unread,
Aug 20, 2021, 1:22:07 PM8/20/21
to co...@lindenlab.com, OpenSource Mailing List
I have built libffi.so from source and built Python3.9.6 linked to libffi.so
>>> import setuptools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nicky/lib/python3.9/site-packages/setuptools/__init__.py", line 20, in <module>
    from setuptools.dist import Distribution, Feature
  File "/home/nicky/lib/python3.9/site-packages/setuptools/dist.py", line 36, in <module>
    from setuptools import windows_support
  File "/home/nicky/lib/python3.9/site-packages/setuptools/windows_support.py", line 2, in <module>
    import ctypes
  File "/home/nicky/lib/python3.9/ctypes/__init__.py", line 8, in <module>

    from _ctypes import Union, Structure, Array
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
>>>
Put libffi.so libfffi.so.7 Sym links to libffi.so.7.1.0 in ctypes and site-packages directories.
Is libffi.so.7 supposed to be a Sym link or the actual .so?
Where should the .so be placed to be visible to _ctypes? 



 

Nicky Perian

unread,
Aug 20, 2021, 1:22:07 PM8/20/21
to Coyot Linden, OpenSource Mailing List
Working now; moved libs to x86_64-linux-gnu.

Nicky Perian

unread,
Aug 20, 2021, 1:22:07 PM8/20/21
to Monty Brandenberg, OpenSource Mailing List
I will try a rebuild with both. 
Looks like this should have been resolved upstream @ python.org long ago.
Thanks for pointing me in the right direction.

--
Archives of earlier incarnations of this list are at https://list-archives.secondlife.com
---
You received this message because you are subscribed to the Google Groups "opensource-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opensource-de...@lists.secondlife.com.
Reply all
Reply to author
Forward
0 new messages