twopirllc / pandas-ta

Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 150+ Indicators
https://twopirllc.github.io/pandas-ta/
MIT License
5.38k stars 1.05k forks source link

TypeError: expected str, bytes or os.PathLike object, not NoneType - v2 #831

Open fridary opened 1 month ago

fridary commented 1 month ago

@twopirllc you are closing issues well, so I created a new one with extra code that you asked here https://github.com/twopirllc/pandas-ta/issues/826


OS: Ubuntu 20.04.6 LTS Server: Intel(R) Xeon(R) CPU E5-2695 v4 @ 2.10GHz Python: 3.11.8 (conda) pip: 24.1.1 pandas-ta: 0.3.14b0 (tested also on 0.4.19b0) TA-Lib: 0.4.32

Have you tried the development version? Did it resolve the issue?

$ pip install -U git+https://github.com/twopirllc/pandas-ta.git@development

the same error

Describe the bug

Traceback (most recent call last):
  File "/home/sirjay/python/ethereum/lib/strategies/BBands.py", line 19, in <module>
    import pandas_ta as pta
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pandas_ta/__init__.py", line 7, in <module>
    from pandas_ta.maps import EXCHANGE_TZ, RATE, Category, Imports, version
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pandas_ta/maps.py", line 4, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3479, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3463, in _call_aside
    f(*args, **kwargs)
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3492, in _initialize_master_working_set
    working_set = _declare_state('object', 'working_set', WorkingSet._build_master())
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 619, in _build_master
    ws = cls()
         ^^^^^
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 612, in __init__
    self.add_entry(entry)
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 668, in add_entry
    for dist in find_distributions(entry, True):
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2120, in find_distributions
    importer = get_importer(path_item)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sirjay/miniconda3/envs/eth/lib/python3.11/pkgutil.py", line 416, in get_importer
    path_item = os.fsdecode(path_item)
                ^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 824, in fsdecode
TypeError: expected str, bytes or os.PathLike object, not NoneType
$ pip list
Package                      Version
---------------------------- -----------
absl-py                      2.1.0
aiodns                       3.2.0
aiofiles                     24.1.0
aiohttp                      3.9.3
aioprocessing                2.0.1
aiosignal                    1.3.1
alchemy-sdk                  0.1.1
alchemy-sdk-py               0.2.0
alembic                      1.13.1
annotated-types              0.6.0
anyio                        4.3.0
ast-comments                 1.2.2
astunparse                   1.6.3
attributedict                0.3.0
attrs                        23.2.0
backoff                      2.2.1
beautifulsoup4               4.12.3
behave                       1.2.6
bidict                       0.23.1
bitarray                     2.9.2
blessings                    1.7
cachetools                   5.3.3
catboost                     1.2.5
ccxt                         4.3.68
certifi                      2024.6.2
cffi                         1.16.0
chardet                      5.2.0
charset-normalizer           3.3.2
ckzg                         1.0.2
click                        8.1.7
codecov                      2.1.13
colorama                     0.4.6
coloredlogs                  15.0.1
colorlog                     6.8.2
colour-runner                0.1.1
contourpy                    1.2.1
coverage                     7.4.4
cryptography                 43.0.0
cssselect                    1.2.0
cycler                       0.12.1
cysystemd                    1.6.2
cytoolz                      0.12.3
dataclass-wizard             0.22.3
deepdiff                     6.7.1
dill                         0.3.8
distlib                      0.3.8
distro                       1.9.0
dm-tree                      0.1.8
dnspython                    2.6.1
eth_abi                      5.1.0
eth-account                  0.12.3
eth-hash                     0.7.0
eth-keyfile                  0.8.0
eth-keys                     0.5.0
eth-rlp                      2.1.0
eth-typing                   4.0.0
eth-utils                    4.0.0
exceptiongroup               1.2.1
execnet                      2.1.1
fastapi                      0.112.2
fasteners                    0.19
filelock                     3.14.0
flatbuffers                  24.3.25
fonttools                    4.51.0
freqtrade                    2024.8
freqtrade-client             2024.8
frozendict                   2.3.10
frozenlist                   1.4.1
gast                         0.4.0
gevent                       24.2.1
google-auth                  2.31.0
google-auth-oauthlib         1.0.0
google-pasta                 0.2.0
graphviz                     0.20.3
greenlet                     3.0.3
grpcio                       1.63.0
h11                          0.14.0
h5py                         3.11.0
hexbytes                     1.2.0
httpcore                     1.0.5
httpx                        0.27.0
humanfriendly                10.0
humanize                     4.10.0
idna                         3.7
iniconfig                    2.0.0
inspecta                     0.1.3
janus                        1.0.0
jax                          0.4.30
jaxlib                       0.4.30
Jinja2                       3.1.4
joblib                       1.4.2
jsonschema                   4.21.1
jsonschema-specifications    2023.12.1
keras                        3.1.1
kiwisolver                   1.4.5
libclang                     18.1.1
llvmlite                     0.43.0
loguru                       0.7.2
lru-dict                     1.2.0
lxml                         5.3.0
Mako                         1.3.5
Markdown                     3.6
markdown-it-py               3.0.0
MarkupSafe                   2.1.5
matplotlib                   3.8.4
mdurl                        0.1.2
ml-dtypes                    0.3.2
moralis                      0.1.45
multidict                    6.0.5
multiprocess                 0.70.16
namex                        0.0.8
nest-asyncio                 1.6.0
numba                        0.60.0
numpy                        1.26.4
nvidia-cublas-cu12           12.3.4.1
nvidia-cuda-cupti-cu12       12.3.101
nvidia-cuda-nvcc-cu12        12.3.107
nvidia-cuda-nvrtc-cu12       12.3.107
nvidia-cuda-runtime-cu12     12.3.101
nvidia-cudnn-cu12            8.9.7.29
nvidia-cufft-cu12            11.0.12.1
nvidia-curand-cu12           10.3.4.107
nvidia-cusolver-cu12         11.5.4.101
nvidia-cusparse-cu12         12.2.0.103
nvidia-nccl-cu12             2.19.3
nvidia-nvjitlink-cu12        12.3.101
oauthlib                     3.2.2
openai                       1.23.4
opt-einsum                   3.3.0
optree                       0.11.0
optuna                       3.6.1
ordered-set                  4.1.0
orjson                       3.10.7
outcome                      1.3.0.post0
packaging                    24.0
pandas                       2.2.2
pandas-datareader            0.10.0
pandas_ta                    0.4.19b0
parameterized                0.9.0
parse                        1.20.1
parse-type                   0.6.2
parsimonious                 0.10.0
pdbp                         1.5.0
pillow                       10.3.0
pip                          24.1.1
platformdirs                 4.2.2
plotly                       5.22.0
pluggy                       1.5.0
prompt-toolkit               3.0.36
protobuf                     4.25.3
psutil                       6.0.0
psycopg2                     2.9.9
py                           1.11.0
py-find-1st                  1.1.6
py4j                         0.10.9.7
pyarrow                      17.0.0
pyasn1                       0.6.0
pyasn1_modules               0.4.0
pycares                      4.4.0
pycoingecko                  3.1.0
pycparser                    2.22
pycryptodome                 3.20.0
pydantic                     2.7.1
pydantic_core                2.18.2
Pygments                     2.18.0
PyJWT                        2.9.0
Pympler                      1.1
pynose                       1.5.1
pyotp                        2.9.0
pyparsing                    3.1.2
pyproject-api                1.6.1
PySocks                      1.7.1
pyspark                      3.5.1
pytest                       8.2.1
pytest-html                  2.0.1
pytest-metadata              3.1.1
pytest-ordering              0.6
pytest-rerunfailures         14.0
pytest-xdist                 3.6.1
python-dateutil              2.8.2
python-dotenv                1.0.1
python-engineio              4.9.1
python-rapidjson             1.20
python-socketio              5.11.2
python-systemd               0.0.9
python-telegram-bot          21.5
python-whois                 0.9.4
pytz                         2024.1
pyunormalize                 15.1.0
PyYAML                       6.0.1
questionary                  2.0.1
referencing                  0.34.0
regex                        2023.12.25
requests                     2.31.0
requests-oauthlib            2.0.0
rich                         13.7.1
rlp                          4.0.0
rootpath                     0.1.1
rpds-py                      0.18.0
rsa                          4.9
sbvirtualdisplay             1.3.0
schedule                     1.2.2
scikit-learn                 1.4.2
scipy                        1.13.0
sdnotify                     0.3.2
selenium                     4.21.0
seleniumbase                 4.27.5
setuptools                   70.1.0
simple-websocket             1.0.0
six                          1.16.0
sniffio                      1.3.1
sortedcontainers             2.4.0
soupsieve                    2.5
SQLAlchemy                   2.0.31
starlette                    0.38.4
TA-Lib                       0.4.32
tabcompleter                 1.3.0
tabulate                     0.9.0
technical                    1.4.4
tenacity                     8.3.0
tensorboard                  2.12.3
tensorboard-data-server      0.7.2
tensorflow                   2.12.0
tensorflow-estimator         2.12.0
tensorflow-io-gcs-filesystem 0.37.0
termcolor                    2.4.0
threadpoolctl                3.5.0
toolz                        0.12.1
tox                          4.14.2
tqdm                         4.66.4
trio                         0.25.1
trio-websocket               0.11.1
typing_extensions            4.12.2
tzdata                       2024.1
urllib3                      1.26.18
uvicorn                      0.30.6
virtualenv                   20.25.1
vscode_deleted_file_recovery 4.0.11
wcwidth                      0.2.13
web3                         7.0.0b6
web3-input-decoder           0.1.11
websocket-client             1.8.0
websockets                   12.0
Werkzeug                     3.0.3
wheel                        0.43.0
wrapt                        1.14.1
wsproto                      1.2.0
xgboost                      2.1.0
yarl                         1.9.4
zope.event                   5.0
zope.interface               6.3

How to fix? Removing pandas_ta and installing again did not help.


extra code for BBands.py:

import pandas_ta as pta
twopirllc commented 1 month ago

Hello @fridary,

Have you tried using a virtualenv instead of (mini) Anaconda? Have you updated to the latest version setuptools?

If the latest setuptools does not fix the issue, please goto setuptools and search open/closed issues or make a new one as this particular issue is breaking the package's requirements.

you are closing issues well, so I created a new one with extra code that you asked here

Thanks for the (backhanded) compliment. You could have just reopened it. 🤷🏼‍♂️

Kind Regards, KJ

twopirllc commented 2 weeks ago

Hello @fridary,

I assume by no response that the solution provided was sufficient. Thus I will be closing this issue in a few days.

Kind Regards, KJ