How to include VTK for Python3 installation into setup.py?
Date : October 28 2020, 04:01 PM
wish helps you Looks like VTK has presented their official binding via pypi, so I can use it in setup.py file simply by appending it to install_requires list. Works well in my project, doesn't need compilation anymore. Though, there is a caution in the mayavi documentation
|
Why do include paths in python2 and python3 differ?
Date : March 29 2020, 07:55 AM
Any of those help Python uses an installation scheme that differs depending on the platform and on the installation options. $ python -c "import sysconfig; print(sysconfig.get_path('include', 'posix_prefix'))"
/usr/include/python2.7
$ python3 -c "import sysconfig; print(sysconfig.get_path('include', 'posix_prefix'))"
/usr/include/python3.5m
$ python -m sysconfig | head
Platform: "linux-x86_64"
Python version: "2.7"
Current installation scheme: "posix_local"
$ python3 -m sysconfig | head
Platform: "linux-x86_64"
Python version: "3.5"
Current installation scheme: "posix_prefix"
def _get_default_scheme():
if os.name == 'posix':
# the default scheme for posix on Debian/Ubuntu is posix_local
# FIXME: return dist-packages/posix_prefix only for
# is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__
# is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local')
return 'posix_local'
return os.name
def _get_default_scheme():
if os.name == 'posix':
# the default scheme for posix is posix_prefix
return 'posix_prefix'
return os.name
sysconfig.get_path('include', 'posix_prefix' if os.name == 'posix' else os.name)
|
When trying to create a Python3.6 virtualenv I get "The executable python3.6 (from --python=python3.6) does not exi
Tag : python , By : Nathan Good
Date : March 29 2020, 07:55 AM
I wish this helpful for you I'm inside desktop/mydirectory and perform virtualenv yourenv -p python3.6. , Either python3.6 is not installed or not found in your path
|
Python3 - Append to array rows that doesn't include certain words
Date : March 29 2020, 07:55 AM
it should still fix some issue I'm trying to create a list of rows that doesn't include 3 specific words. , The issue with your code is here: for i in word_list:
if i in joined:
pass
else:
unknown_row.append(joined)
if not any(i in joined for i in word_list):
unknown_row.append(joined)
|
How to force a library(pybind11) to include <Python.h> from Python3?
Date : March 29 2020, 07:55 AM
I hope this helps you . There are a couple of ways, but AFAIK, none are consistent across all platforms (which is why something like cmake (see: https://github.com/pybind/cmake_example) is often preferred). First, there is python-config, i.e. add: `python-config --includes`
`python3 -c 'import distutils.sysconfig as ds; print(ds.get_python_inc())'`
|