qlib icon indicating copy to clipboard operation
qlib copied to clipboard

ModuleNotFoundError: No module named 'pyqlib' after install qyqlib package

Open david2588e opened this issue 2 years ago • 1 comments

🐛 Bug Description

To Reproduce

Steps to reproduce the behavior:

1.(base) C:\Users\a>cd pyqlib 1.(base) C:\Users\a\pyqlib>python -m build 1.(base) C:\Users\a\pyqlib>touch setup.py (base) C:\Users\a\pyqlib>python -m build

  • Creating venv isolated environment...
  • Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
  • Getting build dependencies for sdist... running egg_info creating pyqlib.egg-info writing pyqlib.egg-info\PKG-INFO writing dependency_links to pyqlib.egg-info\dependency_links.txt writing top-level names to pyqlib.egg-info\top_level.txt writing manifest file 'pyqlib.egg-info\SOURCES.txt' reading manifest file 'pyqlib.egg-info\SOURCES.txt' writing manifest file 'pyqlib.egg-info\SOURCES.txt'
  • Building sdist... running sdist running egg_info writing pyqlib.egg-info\PKG-INFO writing dependency_links to pyqlib.egg-info\dependency_links.txt writing top-level names to pyqlib.egg-info\top_level.txt reading manifest file 'pyqlib.egg-info\SOURCES.txt' writing manifest file 'pyqlib.egg-info\SOURCES.txt' warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

running check creating pyqlib-0.9.3 creating pyqlib-0.9.3\pyqlib.egg-info copying files to pyqlib-0.9.3... copying setup.py -> pyqlib-0.9.3 copying pyqlib.egg-info\PKG-INFO -> pyqlib-0.9.3\pyqlib.egg-info copying pyqlib.egg-info\SOURCES.txt -> pyqlib-0.9.3\pyqlib.egg-info copying pyqlib.egg-info\dependency_links.txt -> pyqlib-0.9.3\pyqlib.egg-info copying pyqlib.egg-info\top_level.txt -> pyqlib-0.9.3\pyqlib.egg-info copying pyqlib.egg-info\SOURCES.txt -> pyqlib-0.9.3\pyqlib.egg-info Writing pyqlib-0.9.3\setup.cfg Creating tar archive removing 'pyqlib-0.9.3' (and everything under it)

  • Building wheel from sdist
  • Creating venv isolated environment...
  • Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
  • Getting build dependencies for wheel... running egg_info writing pyqlib.egg-info\PKG-INFO writing dependency_links to pyqlib.egg-info\dependency_links.txt writing top-level names to pyqlib.egg-info\top_level.txt reading manifest file 'pyqlib.egg-info\SOURCES.txt' writing manifest file 'pyqlib.egg-info\SOURCES.txt'
  • Installing packages in isolated environment... (wheel)
  • Building wheel... running bdist_wheel running build installing to build\bdist.win-amd64\wheel running install running install_egg_info running egg_info writing pyqlib.egg-info\PKG-INFO writing dependency_links to pyqlib.egg-info\dependency_links.txt writing top-level names to pyqlib.egg-info\top_level.txt reading manifest file 'pyqlib.egg-info\SOURCES.txt' writing manifest file 'pyqlib.egg-info\SOURCES.txt' Copying pyqlib.egg-info to build\bdist.win-amd64\wheel.\pyqlib-0.9.3-py3.10.egg-info running install_scripts creating build\bdist.win-amd64\wheel\pyqlib-0.9.3.dist-info\WHEEL creating 'C:\Users\a\pyqlib\dist.tmp-evrubh2o\pyqlib-0.9.3-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to it adding 'pyqlib-0.9.3.dist-info/METADATA' adding 'pyqlib-0.9.3.dist-info/WHEEL' adding 'pyqlib-0.9.3.dist-info/top_level.txt' adding 'pyqlib-0.9.3.dist-info/RECORD' removing build\bdist.win-amd64\wheel Successfully built pyqlib-0.9.3.tar.gz and pyqlib-0.9.3-py3-none-any.whl

(base) C:\Users\a\pyqlib>pip install dist/pyqlib-0.9.3-py3-none-any.whl Processing c:\users\a\pyqlib\dist\pyqlib-0.9.3-py3-none-any.whl Installing collected packages: pyqlib Successfully installed pyqlib-0.9.3

(base) C:\Users\a\pyqlib>pip install dist/pyqlib-0.9.3-py3-none-any.whl Processing c:\users\a\pyqlib\dist\pyqlib-0.9.3-py3-none-any.whl Installing collected packages: pyqlib Successfully installed pyqlib-0.9.3

(base) C:\Users\a\pyqlib>python Python 3.10.9 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:15) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import qlib Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'qlib' import pyqlib Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pyqlib' print(pyqlib.version) Traceback (most recent call last): File "", line 1, in NameError: name 'pyqlib' is not defined import pqlib Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pqlib' import pyqlib Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pyqlib' import pyqlib Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pyqlib' pip show pyqlib File "", line 1 pip show pyqlib ^^^^ SyntaxError: invalid syntax pip show pyqlib File "", line 1 pip show pyqlib ^^^^ SyntaxError: invalid syntax pip show qlib File "", line 1 pip show qlib ^^^^ SyntaxError: invalid syntax pip show "pyqlib" File "", line 1 pip show "pyqlib" ^^^^ SyntaxError: invalid syntax import sys print(sys.path) ['', 'C:\Users\a\anaconda3\python310.zip', 'C:\Users\a\anaconda3\DLLs', 'C:\Users\a\anaconda3\lib', 'C:\Users\a\anaconda3', 'C:\Users\a\AppData\Roaming\Python\Python310\site-packages', 'C:\Users\a\anaconda3\lib\site-packages', 'C:\Users\a\anaconda3\lib\site-packages\win32', 'C:\Users\a\anaconda3\lib\site-packages\win32\lib', 'C:\Users\a\anaconda3\lib\site-packages\Pythonwin'] exit()

(base) C:\Users\a\pyqlib>python -m pip show pyqlib Name: pyqlib Version: 0.9.3 Summary: Home-page: Author: Author-email: License: Location: c:\users\a\anaconda3\lib\site-packages Requires: Required-by:

(base) C:\Users\a\pyqlib>conda create -n test python=3.10 Collecting package metadata (current_repodata.json): done Solving environment: done

==> WARNING: A newer version of conda exists. <== current version: 23.1.0 latest version: 23.10.0

Please update conda by running

$ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

 conda install conda=23.10.0

Package Plan

environment location: C:\Users\a\anaconda3\envs\test

added / updated specs: - python=3.10

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
ca-certificates-2023.08.22 |       haa95532_0         123 KB
pip-23.3.1                 |  py310haa95532_0         2.9 MB
setuptools-68.0.0          |  py310haa95532_0         934 KB
wheel-0.41.2               |  py310haa95532_0         127 KB
------------------------------------------------------------
                                       Total:         4.0 MB

The following NEW packages will be INSTALLED:

bzip2 pkgs/main/win-64::bzip2-1.0.8-he774522_0 ca-certificates pkgs/main/win-64::ca-certificates-2023.08.22-haa95532_0 libffi pkgs/main/win-64::libffi-3.4.4-hd77b12b_0 openssl pkgs/main/win-64::openssl-3.0.12-h2bbff1b_0 pip pkgs/main/win-64::pip-23.3.1-py310haa95532_0 python pkgs/main/win-64::python-3.10.13-he1021f5_0 setuptools pkgs/main/win-64::setuptools-68.0.0-py310haa95532_0 sqlite pkgs/main/win-64::sqlite-3.41.2-h2bbff1b_0 tk pkgs/main/win-64::tk-8.6.12-h2bbff1b_0 tzdata pkgs/main/noarch::tzdata-2023c-h04d1e81_0 vc pkgs/main/win-64::vc-14.2-h21ff451_1 vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2 wheel pkgs/main/win-64::wheel-0.41.2-py310haa95532_0 xz pkgs/main/win-64::xz-5.4.2-h8cc25b3_0 zlib pkgs/main/win-64::zlib-1.2.13-h8cc25b3_0

(test) C:\Users\a\pyqlib>pip install dist/pyqlib-0.9.3-py3-none-any.whl Processing c:\users\a\pyqlib\dist\pyqlib-0.9.3-py3-none-any.whl Installing collected packages: pyqlib Successfully installed pyqlib-0.9.3

(test) C:\Users\a\pyqlib>python -c "import pyqlib" Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pyqlib' (base) C:\Users\a\pyqlib>activate test

(test) C:\Users\a\pyqlib>pip show pyqlib WARNING: Package(s) not found: pyqlib

(test) C:\Users\a\pyqlib>pip install pyqlib ERROR: Could not find a version that satisfies the requirement pyqlib (from versions: none) ERROR: No matching distribution found for pyqlib

(test) C:\Users\a\pyqlib>pip install https://files.pythonhosted.org/packages/b3/f9/321b8ccaacdfe250e27c168bd95f80b1ab90d3d695d033642971130aea90/pyqlib-0.9.3-cp310-cp310-win_amd64.whl Collecting pyqlib==0.9.3 ERROR: HTTP error 404 while getting https://files.pythonhosted.org/packages/b3/f9/321b8ccaacdfe250e27c168bd95f80b1ab90d3d695d033642971130aea90/pyqlib-0.9.3-cp310-cp310-win_amd64.whl ERROR: Could not install requirement pyqlib==0.9.3 from https://files.pythonhosted.org/packages/b3/f9/321b8ccaacdfe250e27c168bd95f80b1ab90d3d695d033642971130aea90/pyqlib-0.9.3-cp310-cp310-win_amd64.whl because of HTTP error 404 Client Error: Not Found for url: https://files.pythonhosted.org/packages/b3/f9/321b8ccaacdfe250e27c168bd95f80b1ab90d3d695d033642971130aea90/pyqlib-0.9.3-cp310-cp310-win_amd64.whl for URL https://files.pythonhosted.org/packages/b3/f9/321b8ccaacdfe250e27c168bd95f80b1ab90d3d695d033642971130aea90/pyqlib-0.9.3-cp310-cp310-win_amd64.whl

Expected Behavior

Screenshot

Environment

Note: User could run cd scripts && python collect_info.py all under project directory to get system information and paste them here directly.

  • Qlib version:pyqlib==0.9.3
  • Python version: python pkgs/main/win-64::python-3.10.13-he1021f5_0
  • OS (Windows, Linux, MacOS): Windows
  • Commit number (optional, please provide it if you are using the dev version):

Additional Notes

david2588e avatar Dec 02 '23 15:12 david2588e

I understand that you may want to package qlib and install it later. I made some attempts on my computer :.

  1. First, I pulled down the latest version of qlib using git, and changed the version number.
  2. Then use the python setup.py bdist_wheel command to package it.
  3. After packaging, create a new virtual environment and install it with pip install <you_package name.whl>.
  4. Finally, I tested import qlib and found no problems.

I think there might be a problem with the packaging.

  1. And I tried installing it with pip install pyqlib after recreating the virtual environment and I didn't find any problem.

According to your error message it doesn't look like a problem with qlib but more like a network problem.

image

SunsetWolf avatar Jan 04 '24 12:01 SunsetWolf