[英]Distutils build include C++ library with setup
我正在嘗試將 glfw 鏈接到我的 C++ python 擴展名,但沒有 cmake 我無法做到這一點。 這是我在 cmake 中的做法: 這很好用。 這是我在 distutils 中嘗試做的事情:from distutils.core import setup, Extension from di ...
[英]Distutils build include C++ library with setup
我正在嘗試將 glfw 鏈接到我的 C++ python 擴展名,但沒有 cmake 我無法做到這一點。 這是我在 cmake 中的做法: 這很好用。 這是我在 distutils 中嘗試做的事情:from distutils.core import setup, Extension from di ...
[英]No module named 'distutils.command.bdist_msi'
在 Pycharm (Windows 11) 中,我建立了一個包含一行的基本項目: 環境為Virtualenv,基本解釋器路徑為C:\Users\strat\AppData\Local\Programs\Python311\python.exe 當然,由於未安裝模塊,我得到: 所以我嘗試安裝它,就像 ...
[英]How to provide C++ version when extending python
我想讓 c++ 代碼可以從 python 調用。 https://docs.python.org/3/extending/解釋了如何做到這一點,但沒有提到如何指定 c++ 版本。 默認情況下,distutils 使用一堆 arguments 調用 g++,但是不提供版本參數。 setup.py ...
[英]PyYAML failure to install with PyAutoLens on Ubuntu
我正在嘗試使用 pip/pip3 在運行 Ubuntu 20.04 的筆記本電腦上安裝 PyAutoLens。 在 go 看來,這一切似乎都很好,然后我得到以下信息,並且所有依賴項似乎都得到滿足,直到: 我正在運行 Python 3.8。 研究表明 distutils 將來會被棄用。 我意識到我可 ...
[英]Custom module installed but can import by name
我有一個項目,我正在嘗試使用 conda、安裝和運行 package。 盡管已安裝,但我無法按名稱導入模塊。 但是,我可以導入模塊main.py並執行它的 function print_hi 。 如下所示。 我的項目結構。 似乎與建議的文件結構一致,盡管我假設問題出在結構上。 ...
[英]Use distutils setuptools for compile and link
我想將一些 cython(和 cython_freeze)生成的 c 文件編譯並鏈接到可執行文件中(在 Windows 和 Linux 上) 我可以通過設置(特定於機器的)環境(例如,什么 C 編譯器,它安裝在哪里(路徑),包含目錄,什么 lib 目錄......)並直接調用 cl (帶有一些特定於 ...
[英]Cython embed on Windows
我已閱讀How to enable `--embed` with cythonize? 和Cython --embed 標志在 setup.py但此方法不適用於 Windows。 假設我們有: 在適用於 Windows 的 Python 3.8 上運行此build.py腳本不會像使用命令行命令 ...
[英]Python 3.10 deprecation warning for distutils
DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternati ...
[英]What is the replacement for distutils.util.get_platform()?
顯然,Python 3.10 / 3.12 將棄用/刪除 distutils。 不幸的是,我一直無法找到我正在使用的唯一一個 function 的替代品; distutils.util.get_platform() 。 這個有什么替代品? 請注意, platform不是答案。 我需要一個 fun ...
[英]from numpy.distutils.core import Extension as Ext ModuleNotFoundError: No module named 'numpy'
嘗試使用 python3.x 構建我的 package(python -m build)時出現以下錯誤 ModuleNotFoundError:沒有名為“numpy”的模塊 ...
[英]No module named 'distutils.util'
我正在研究 ubuntu 16.0.4 LTS 並且在 python 3.8 中創建虛擬環境時,我沒有得到名為“distutils.util”的模塊我正在使用存儲庫: sudo add-apt-repository ppa:deadsnakes/ppa我嘗試了以下但沒有用 我已經嘗試了這個鏈接的解 ...
[英]AttributeError: module 'setuptools._distutils' has no attribute 'version'
我正在嘗試使用張量板訓練 model。 執行時,我收到此錯誤: $ python train.py Traceback (most recent call last): File "train.py", line 6, in <module> from torch.utils.tens ...
[英]wsl ubuntu 20.04 -> with python3.9 and without python3.8
想要將python3.9與實際pip和venv一起使用。 並刪除python3.8 。 我已經像那樣安裝了python3.9 。 然后pip 。 和python3.9-venv使用apt 。 問題是pip和venv使用distutils 。 Whish 通過python3-distutils下載 ...
[英]Python distutils keyError
我在 setup.py 文件中有一個 disutils 的工作代碼,如下所示 但是今天我嘗試在 github 操作中運行 CI 時出現以下錯誤 我沒有足夠的資源來找出解決方案,是的 distutils 已被棄用,但是由於代碼一直工作到今天早上,任何人都可以指出正確的解決方法嗎? ...
[英]no module named distutils....but distutils installed?
我想升級我的 python 版本(在本例中為 3.10),所以在安裝 python3.10 之后,我繼續嘗試添加一些我使用的模塊,例如 opencv,它遇到了: 由於似乎已經安裝了 distutils,我無法理解如何繼續。 ...
[英]How to include additional files into a package?
如何將不是用 python 編寫的文件包含到包裝中? 或者更具體地說:假設我有以下包結構,我如何包含模板目錄的所有文件? 我有以下setup.py 當我在 stackoverflow 上的某處閱讀時,我嘗試將以下內容添加到setup.py文件中,但沒有任何區別。 ...
[英]How to specify requirements in Python packages metadata
核心元數據規范記錄了元數據字段Requires-External ,它似乎用於指定系統(非 Python)依賴項。 但是,您實際上如何指定此字段? 這是我嘗試過的: setup.py內容 當我構建這個包時,元數據不包括在內 那么將Requires-External傳遞給 setup ...
[英]setup with submodules dependencies
我們有一個 python 包,它也是一個 git repo。 這取決於其他 python 包,它們本身就是 git repos。 我們制作了前者的后者 git 子模塊。 這些都不是公開的,所以沒有 PyPI。 與使用子模塊依賴項進行安裝相關的其他問題都不符合我們的模式。 我的問題不是關於使用set ...
[英]invalid command 'npm run build' when running it from setup.py
我正在嘗試使用 npm 通過setup.py配置文件npm run build來構建我的應用程序的 Javascript 端。 我正在按照其他地方的建議使用來自distutils的build class,但是當我運行pip install. 有誰知道為什么會這樣? 編輯 1:所以它似乎不是運行npm ...
[英]PermissionError: [WinError 5] Access is denied after using distutils
我一直在 Python 中遇到這個錯誤,但我並不聰明。 我已將一些文件夾和文件從一個目錄復制到另一個目錄: copy.py convert.py 現在每次我運行python convert.py我都會得到: 我試過在管理員中運行 VSCode,還有Set-ExecutionPolicy ...