Tar.gz की पाइप स्थापना के साथ 'साइथन' नाम का कोई मॉड्यूल नहीं


10

मैं अपने उदाहरण पैकेज ( https://github.com/iamishalkin/cyrtd ) के लिए tar.gz और whl फ़ाइलों के निर्माण के लिए पोएट्री का उपयोग करता हूं और फिर pipenv पर्यावरण के अंदर पैकेज को स्थापित करने का प्रयास करता हूं। tar.gz इंस्टॉलेशन विफल हो जाता है और यह लॉग का एक टुकड़ा है:

$ poetry build
...
$ pip install dist/cyrtd-0.1.0.tar.gz
Processing c:\work2\cyrtd\dist\cyrtd-0.1.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: cython<0.30.0,>=0.29.13 in c:\users\ivan.mishalkin\.virtualenvs\cyrtd-tpdvsw8x\lib\site-packages (from cyrtd==0.1.0) (0.29.15)
Building wheels for collected packages: cyrtd
  Building wheel for cyrtd (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
...
from Cython.Build import cythonize
  ModuleNotFoundError: No module named 'Cython'  
  ----------------------------------------
  ERROR: Failed building wheel for dxpyfeed
Failed to build dxpyfeed
ERROR: Could not build wheels for dxpyfeed which use PEP 517 and cannot be installed directly

साइथॉन स्थापित है और आभासी दुभाषिया से कॉल करने योग्य है। यहां तक ​​कि लॉग में यह भी लिखा है, कि साइथन के लिए आवश्यकताओं को संतुष्ट किया जाता है। क्या अजीब है - सब कुछ ठीक कुछ महीने पहले काम किया। मैंने कोंडा वेनव, अपग्रेड किए गए साइथॉन और कविता की भी कोशिश की, कुछ भी मदद नहीं की। इसके अलावा Cython के साथ setup_requires से कमजोर रूप से संबंधित वर्कअराउंड की कोशिश की ? - फिर भी नसीब नहीं

UPD : मुझे यहाँ कुछ गंदे काम मिले: https://luminousmen.com/post/resolve-cython-and-numpy-d dependencies

जोड़ने का विचार है

from setuptools import dist
dist.Distribution().fetch_build_eggs(['cython'])

Cython.Build आयात से पहले

इसके बाद मुझे ये लॉग मिलते हैं:

$ pip install dist/cyrtd-0.1.0.tar.gz
Processing c:\work2\cyrtd\dist\cyrtd-0.1.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: cython<0.30.0,>=0.29.13 in c:\users\ivan.mishalkin\.virtualenvs\cyrtd-tpdvsw8x\lib\site-packages (from cyrtd==0.1.0) (0.29.15)
Building wheels for collected packages: cyrtd
  Building wheel for cyrtd (PEP 517) ... done
  Created wheel for cyrtd: filename=cyrtd-0.1.0-cp37-cp37m-win_amd64.whl size=33062 sha256=370a90657759d3183f3c11ebbdf1d23c3ca857d41dd45a86386ba33a6baf9a07
  Stored in directory: c:\users\ivan.mishalkin\appdata\local\pip\cache\wheels\45\d1\6b\52daecf1cc5234ca4d9e9e49b2f195e7adb83941424116432e
Successfully built cyrtd
Installing collected packages: cyrtd
  Attempting uninstall: cyrtd
    Found existing installation: cyrtd 0.1.0
    Uninstalling cyrtd-0.1.0:
      Successfully uninstalled cyrtd-0.1.0
Successfully installed cyrtd-0.1.0

फिर भी एक बेहतर समाधान की तलाश में

UPD2: मुख्य फ़ाइलें सामग्री: build.py:

from setuptools import Extension
from Cython.Build import cythonize

cyfuncs_ext = Extension(name='cyrtd.cymod.cyfuncs',
                        sources=['cyrtd/cymod/cyfuncs.pyx']
                        )

EXTENSIONS = [
    cyfuncs_ext
]

def build(setup_kwargs):
    setup_kwargs.update({
        'ext_modules': cythonize(EXTENSIONS, language_level=3),
        'zip_safe': False,
        'setup_requires':['setuptools>=18.0', 'cython']
    })

1
क्या build.pyस्क्रिप्ट को मान के रूप में सेट किया गया है [tool.poetry].build, या आप इसे कैसे बांधते हैं?
अर्ने

1
@ हाँ, बेशक यह pyproject.tomlफ़ाइल में बाँधा गया है। प्रश्न से रेपो में सभी कोड शामिल हैं
इवान मिशालकिन

आह, मैंने नहीं देखा कि आपने अपना रेपो लिंक किया है। क्या यह आपके लिए एक उचित समाधान है, या आप अभी भी कुछ बेहतर देख रहे हैं? यदि यह काफी अच्छा है, तो इसे स्व-निहित उत्तर के रूप में पोस्ट करने पर विचार करें।
Arne

@ कुछ समय पहले इस तरह के वर्कअराउंड के बिना सबकुछ ठीक हो जाता है, इसलिए मुझे विश्वास है कि बेहतर समाधान है। समस्या यह है कि मुझे नहीं पता, क्या बदल गया है और बग की खोज कहाँ है
इवान मिशालकिन

जवाबों:


0

बिल्ड-सिस्टम सेक्शन में साइथन को जोड़ने से pyproject.tomlमुझे मदद मिली

pyproject.toml:

...
[build-system]
requires = ["poetry>=0.12", "cython"]
...
हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.