You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I extracted all the newest codes (2022-Jan-17) into PyCharm IDE (2021.3.1 Community Edition), and created a virtual Python 3.8 environment, it automatically detected that "Package requirements 'pyecharts>=1.9.0', 'tqdm', 'pandas>=1.1.0', 'zb>=0.0.14', 'numpy>=1.16.5', 'transitions', 'tushare', 'python-docx>=0.8.11','matplotlib','seaborn','Deprecated>=1.2.12' are not satisfied". This prompted me automatically install these package after clicking a button "Install requirements".
After such successful installation, I did run the following commands, within PyCharm IDE:
(1) setup.py --help
Successful, to see what commands I can run
(2) setup.py install
Most success, but with the following warning
reating 'dist/czsc-0.8.13-py3.8.egg' and adding 'build/bdist.linux-x86_64/egg' to it
zip_safe flag not set; analyzing archive contents...
czsc.sensors.pycache.plates.cpython-38: module MAY be using inspect.getsource
czsc.sensors.pycache.stocks.cpython-38: module MAY be using inspect.getsource
hist.scripts_gm_20211212.pycache.run_share_bt.cpython-38: module references file
hist.scripts_gm_20211212.pycache.run_share_rt.cpython-38: module references file
hist.scripts_gm_20211212.src.utils.pycache.bt.cpython-38: module MAY be using inspect.getsource
hist.scripts_gm_20211212.src.utils.pycache.rt.cpython-38: module MAY be using inspect.getsource
(3) setup.py build
Successful, I saw the build directory with sub directories 'lib' and 'bdist.linux-x86_64' were created
(4) When I run the core code 'analyze.py' without any arguments or inputs, I got the following error:
Traceback (most recent call last):
File "/home/Downloads/czsc-master/czsc/analyze.py", line 3, in
import webbrowser
File "/usr/lib/python3.8/webbrowser.py", line 6, in
import shlex
File "/usr/lib/python3.8/shlex.py", line 11, in
import re
File "/usr/lib/python3.8/re.py", line 124, in
import enum
File "/home/Downloads/czsc-master/czsc/enum.py", line 3, in
from enum import Enum
ImportError: cannot import name 'Enum' from partially initialized module 'enum' (most likely due to a circular import)
(5) For the 'bar_generator.py' under the folder 'utils', it has the following statement:
from ..objects import RawBar, Freq
I know this is to import the 'object.py' within the parent folder ('czcs') of 'utils'. After running this code without any arguments or inputs, I got the following error:
/home/Downloads/czsc-master/venv/bin/python /home/Downloads/czsc-master/czsc/utils/bar_generator.py
Traceback (most recent call last):
File "/home/Downloads/czsc-master/czsc/utils/bar_generator.py", line 10, in
from ..objects import RawBar, Freq
ImportError: attempted relative import with no known parent package
I noticed that the library inclusion in this package uses folders and sub-folder structures, which causes "circular import" problem with PyCharm IDE.
I am curious that has anyone ever encounters such a problem? Or, what python IDE do you use, which does not have any problems such as "circular import".
Thank you for your attention! Your help will be highly appreciated!
John
The text was updated successfully, but these errors were encountered:
There are not any "circular import" in czsc source code. As a third library, you should install czsc by pip install czsc or python setup.py install, then use it in your python console, for example:
importczscfromczsc.objectsimportRawBar, Freq
After execute codes above, you will see version hints like:
Dear Developers:
When I extracted all the newest codes (2022-Jan-17) into PyCharm IDE (2021.3.1 Community Edition), and created a virtual Python 3.8 environment, it automatically detected that "Package requirements 'pyecharts>=1.9.0', 'tqdm', 'pandas>=1.1.0', 'zb>=0.0.14', 'numpy>=1.16.5', 'transitions', 'tushare', 'python-docx>=0.8.11','matplotlib','seaborn','Deprecated>=1.2.12' are not satisfied". This prompted me automatically install these package after clicking a button "Install requirements".
After such successful installation, I did run the following commands, within PyCharm IDE:
(1) setup.py --help
Successful, to see what commands I can run
(2) setup.py install
Most success, but with the following warning
reating 'dist/czsc-0.8.13-py3.8.egg' and adding 'build/bdist.linux-x86_64/egg' to it
zip_safe flag not set; analyzing archive contents...
czsc.sensors.pycache.plates.cpython-38: module MAY be using inspect.getsource
czsc.sensors.pycache.stocks.cpython-38: module MAY be using inspect.getsource
hist.scripts_gm_20211212.pycache.run_share_bt.cpython-38: module references file
hist.scripts_gm_20211212.pycache.run_share_rt.cpython-38: module references file
hist.scripts_gm_20211212.src.utils.pycache.bt.cpython-38: module MAY be using inspect.getsource
hist.scripts_gm_20211212.src.utils.pycache.rt.cpython-38: module MAY be using inspect.getsource
(3) setup.py build
Successful, I saw the build directory with sub directories 'lib' and 'bdist.linux-x86_64' were created
(4) When I run the core code 'analyze.py' without any arguments or inputs, I got the following error:
Traceback (most recent call last):
File "/home/Downloads/czsc-master/czsc/analyze.py", line 3, in
import webbrowser
File "/usr/lib/python3.8/webbrowser.py", line 6, in
import shlex
File "/usr/lib/python3.8/shlex.py", line 11, in
import re
File "/usr/lib/python3.8/re.py", line 124, in
import enum
File "/home/Downloads/czsc-master/czsc/enum.py", line 3, in
from enum import Enum
ImportError: cannot import name 'Enum' from partially initialized module 'enum' (most likely due to a circular import)
(5) For the 'bar_generator.py' under the folder 'utils', it has the following statement:
from ..objects import RawBar, Freq
I know this is to import the 'object.py' within the parent folder ('czcs') of 'utils'. After running this code without any arguments or inputs, I got the following error:
/home/Downloads/czsc-master/venv/bin/python /home/Downloads/czsc-master/czsc/utils/bar_generator.py
Traceback (most recent call last):
File "/home/Downloads/czsc-master/czsc/utils/bar_generator.py", line 10, in
from ..objects import RawBar, Freq
ImportError: attempted relative import with no known parent package
I noticed that the library inclusion in this package uses folders and sub-folder structures, which causes "circular import" problem with PyCharm IDE.
I am curious that has anyone ever encounters such a problem? Or, what python IDE do you use, which does not have any problems such as "circular import".
Thank you for your attention! Your help will be highly appreciated!
John
The text was updated successfully, but these errors were encountered: