Uncategorized

Data Analysis with Python Projects – Mean-Variance-Standard Deviation Calculator – Python


Tell us what’s happening:

Describe your issue in detail here.
I haven’t started the codes for this challenge yet. So, this post is not about doubts about the code to solve the challenge itself.
This looks like a problem with the set of files available on Github to be used in Replit.
I always follow the same procedure to start a project like this, as instructed. Start by importing the project on Replit; Next, you will see a .replit window; Select Use run command and click the Done button.
After that I hit Run to proper install / initiate the dependencies, such as Numpy.
In this project I’m receiving the following console error:

→ poetry lock –no-update
Resolving dependencies…

Writing lock file
→ poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

• Installing numpy (1.18.5)

ChefBuildError

Backend subprocess exited when trying to invoke build_wheel

Running from numpy source directory.
/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
required_version = LooseVersion(‘0.29.14’)
/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cython_version) < required_version:

Error compiling Cython file:


for i in range(1, RK_STATE_LEN):
self.rng_state.key[i] = val[i]
self.rng_state.pos = i

      self._bitgen.state = &self.rng_state
      self._bitgen.next_uint64 = &mt19937_uint64
                                 ^

_mt19937.pyx:138:35: Cannot assign type ‘uint64_t (*)(void ) except? -1 nogil’ to ‘uint64_t ()(void *) noexcept nogil’. Exception values are incompatible. Suggest adding ‘noexcept’ to type ‘uint64_t (void *) except? -1 nogil’.
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_mt19937.pyx
Traceback (most recent call last):
File “/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py”, line 238, in
main()
File “/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py”, line 234, in main
find_process_files(root_dir)
File “/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py”, line 225, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File “/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py”, line 191, in process
processor_function(fromfile, tofile)
File “/tmp/tmpprwakulo/numpy-1.18.5/tools/cythonize.py”, line 80, in process_pyx
subprocess.check_call(
File “/nix/store/xf54733x4chbawkh1qvy9i1i4mlscy1c-python3-3.10.11/lib/python3.10/subprocess.py”, line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/tmp/tmppfi4itx3/.venv/bin/python’, ‘-m’, ‘cython’, ‘-3’, ‘–fast-fail’, ‘-o’, ‘_mt19937.c’, ‘_mt19937.pyx’]’ returned non-zero exit status 1.
Cythonizing sources
Traceback (most recent call last):
File “/nix/store/fcbymdrl3n3ksr6z2zbsmsb2vnixyz39-poetry-in-venv/env/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py”, line 353, in
main()
File “/nix/store/fcbymdrl3n3ksr6z2zbsmsb2vnixyz39-poetry-in-venv/env/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py”, line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
File “/nix/store/fcbymdrl3n3ksr6z2zbsmsb2vnixyz39-poetry-in-venv/env/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py”, line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File “/nix/store/icx0zbk2r2qrpnqpd41q4h4xzr856d4f-python3.10-setuptools-67.4.0/lib/python3.10/site-packages/setuptools/build_meta.py”, line 413, in build_wheel
return self._build_with_temp_dir([‘bdist_wheel’], ‘.whl’,
File “/nix/store/icx0zbk2r2qrpnqpd41q4h4xzr856d4f-python3.10-setuptools-67.4.0/lib/python3.10/site-packages/setuptools/build_meta.py”, line 398, in _build_with_temp_dir
self.run_setup()
File “/nix/store/icx0zbk2r2qrpnqpd41q4h4xzr856d4f-python3.10-setuptools-67.4.0/lib/python3.10/site-packages/setuptools/build_meta.py”, line 484, in run_setup
super(_BuildMetaLegacyBackend,
File “/nix/store/icx0zbk2r2qrpnqpd41q4h4xzr856d4f-python3.10-setuptools-67.4.0/lib/python3.10/site-packages/setuptools/build_meta.py”, line 335, in run_setup
exec(code, locals())
File “”, line 488, in
File “”, line 469, in setup_package
File “”, line 275, in generate_cython
RuntimeError: Running cythonize failed!

at /nix/store/fcbymdrl3n3ksr6z2zbsmsb2vnixyz39-poetry-in-venv/env/lib/python3.10/site-packages/poetry/installation/chef.py:147 in _prepare
143│
144│ error = ChefBuildError(“\n\n”.join(message_parts))
145│
146│ if error is not None:
→ 147│ raise error from None
148│
149│ return path
150│
151│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) → Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with numpy (1.18.5) not supporting PEP 517 builds. You can verify this by running ‘pip wheel –use-pep517 “numpy (==1.18.5)”’.

exit status 1


I’ve tried “pip wheel –use-pep517 “numpy (==1.18.5)”” in the terminal (shell) and received the following error:

pip wheel –use-pep517 “numpy (==1.18.5)”
Collecting numpy==1.18.5
Downloading numpy-1.18.5.zip (5.4 MB)
|████████████████████████████████| 5.4 MB 4.0 MB/s
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing wheel metadata … error
ERROR: Command errored out with exit status 1:
command: /nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/bin/python3.10 /nix/store/s4cbcvnm0miclkjwj6g8fxcn8fgb78s1-python3.10-pip-21.2.dev0/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpc2no8rhf
cwd: /tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a
Complete output (54 lines):
Running from numpy source directory.
:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
required_version = LooseVersion(‘0.29.14’)
/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cython_version) < required_version:

Error compiling Cython file:
------------------------------------------------------------
...
        for i in range(1, RK_STATE_LEN):
            self.rng_state.key[i] = val[i]
        self.rng_state.pos = i

        self._bitgen.state = &self.rng_state
        self._bitgen.next_uint64 = &mt19937_uint64
                                   ^
------------------------------------------------------------

_mt19937.pyx:138:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'uint64_t (void *) except? -1 nogil'.
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_mt19937.pyx
Traceback (most recent call last):
  File "/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py", line 238, in <module>
    main()
  File "/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py", line 234, in main
    find_process_files(root_dir)
  File "/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py", line 225, in find_process_files
    process(root_dir, fromfile, tofile, function, hash_db)
  File "/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py", line 191, in process
    processor_function(fromfile, tofile)
  File "/tmp/pip-wheel-u5b3w4s0/numpy_c0989e3e43554dcfb68ffccdf7bd422a/tools/cythonize.py", line 80, in process_pyx
    subprocess.check_call(
  File "/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/bin/python3.10', '-m', 'cython', '-3', '--fast-fail', '-o', '_mt19937.c', '_mt19937.pyx']' returned non-zero exit status 1.
Cythonizing sources
Traceback (most recent call last):
  File "/nix/store/s4cbcvnm0miclkjwj6g8fxcn8fgb78s1-python3.10-pip-21.2.dev0/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
    main()
  File "/nix/store/s4cbcvnm0miclkjwj6g8fxcn8fgb78s1-python3.10-pip-21.2.dev0/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/nix/store/s4cbcvnm0miclkjwj6g8fxcn8fgb78s1-python3.10-pip-21.2.dev0/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 133, in prepare_metadata_for_build_wheel
    return hook(metadata_directory, config_settings)
  File "/tmp/pip-build-env-cyslt9vv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
    self.run_setup()
  File "/tmp/pip-build-env-cyslt9vv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup
    super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
  File "/tmp/pip-build-env-cyslt9vv/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 488, in <module>
  File "<string>", line 469, in setup_package
  File "<string>", line 275, in generate_cython
RuntimeError: Running cythonize failed!
----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/01/1b/d3ddcabd5817be02df0e6ee20d64f77ff6d0d97f83b77f65e98c8a651981/numpy-1.18.5.zip#sha256=34e96e9dae65c4839bd80012023aadd6ee2ccb73ce7fdf3074c62f301e63120b (from Links for numpy) (requires-python:>=3.5). Command errored out with exit status 1: /nix/store/lwzzgbnj41d657lpxczk6l5f7d5zcnj1-python3-3.10.11/bin/python3.10 /nix/store/s4cbcvnm0miclkjwj6g8fxcn8fgb78s1-python3.10-pip-21.2.dev0/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpc2no8rhf Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement numpy==1.18.5 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 1.22.4, 1.23.0rc1, 1.23.0rc2, 1.23.0rc3, 1.23.0, 1.23.1, 1.23.2, 1.23.3, 1.23.4, 1.23.5, 1.24.0rc1, 1.24.0rc2, 1.24.0, 1.24.1, 1.24.2, 1.24.3, 1.24.4, 1.25.0rc1, 1.25.0, 1.25.1, 1.25.2, 1.26.0b1, 1.26.0rc1, 1.26.0, 1.26.1, 1.26.2, 1.26.3)
ERROR: No matching distribution found for numpy==1.18.5
 Detected change in environment, reloading shell…


I’ve tried several times to download again the repo from GitHub and star all over in Replit, but the result is always the same. I’ve tried a very basic code in the file mean_var_std.py

import numpy as np

a = np.array([1, 2, 3, 4])
print(a)

And the console returns what I’ve expected:

python3 mean_var_std.py
Traceback (most recent call last):
File “/home/runner/boilerplate-mean-variance-standard-deviation-calculator-3/mean_var_std.py”, line 1, in
import numpy as np
ModuleNotFoundError: No module named ‘numpy’

For me looks like some inste with the chosen version of NumPY to install. But I really don’t know what to do. Please somebody can help me with that? Maybe some crew member should be the better person to manage an issue like this.
Thanx!!

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0

Challenge Information:

Data Analysis with Python Projects – Mean-Variance-Standard Deviation Calculator



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *