Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install -e . — AttributeError: module 'vectorbt' has no attribute 'settings' #624

Open
dougransom opened this issue Jul 15, 2023 · 2 comments

Comments

@dougransom
Copy link

Attempted to run after an install using pip install -e ..

`(.venv) PS C:\Users\doug\code\vectorbt> py
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

`

From the BitcoinDMAC example:

`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[3], line 11
8 time_buffer = timedelta(days=100) # buffer before to pre-calculate SMA/EMA, best to set to max window
9 freq = '1D'
---> 11 vbt.settings.portfolio['init_cash'] = 100. # 100$
12 vbt.settings.portfolio['fees'] = 0.0025 # 0.25%
13 vbt.settings.portfolio['slippage'] = 0.0025 # 0.25%

AttributeError: module 'vectorbt' has no attribute 'settings'`

information about local install:
(.venv) PS C:\Users\doug\code\vectorbt> pip show vectorbt Name: vectorbt Version: 0.25.5 Summary: Python library for backtesting and analyzing trading strategies at scale Home-page: https://github.com/polakowo/vectorbt Author: Oleg Polakow Author-email: [email protected] License: Apache 2.0 with Commons Clause Location: c:\users\doug\code\vectorbt\.venv\lib\site-packages Editable project location: C:\Users\doug\code\vectorbt Requires: dateparser, dill, imageio, ipywidgets, matplotlib, mypy-extensions, numba, numpy, pandas, plotly, pytz, requests, schedule, scikit-learn, scipy, tqdm Required-by:

The problem doesn't manifest when installing from PyPi.

@dougransom
Copy link
Author

@polakowo I am guessing this has to do with utils.import_submodules not walking the path where the code is located or maybe even working at all . If that makes sense to you assign it to me and I'll dig into it.

@dougransom
Copy link
Author

Ok, I found the following works:
pip install -e . --config-settings editable_mode=strict
after reading https://setuptools.pypa.io/en/latest/userguide/development_mode.html.
To resolve this issue, I suggest the readme.md be updated to provide the installation instructions, and find some way to throw an exception for editable installs without editable_mode=strict.

@polakowo let me know if you want me to make those changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant