#๐Ÿ”’ Include library installed by pipx, simple script

9 messages ยท Page 1 of 1 (latest)

sleek marten
#

I have a script in home directory test.py


username = '--
password = '--'

tv = TvDatafeed(username, password)

# index
nifty_index_data = tv.get_hist(symbol='NIFTY',exchange='NSE',interval=Interval.in_1_hour,n_bars=1000)

# futures continuous contract
nifty_futures_data = tv.get_hist(symbol='NIFTY',exchange='NSE',interval=Interval.in_1_hour,n_bars=1000,fut_contract=1)

# crudeoil
crudeoil_data = tv.get_hist(symbol='CRUDEOIL',exchange='MCX',interval=Interval.in_1_hour,n_bars=5000,fut_contract=1)

# downloading data for extended market hours
extended_price_data = tv.get_hist(symbol="EICHERMOT",exchange="NSE",interval=Interval.in_1_hour,n_bars=500, extended_session=False)

nq_data = tv.get_hist(symbol='NQ',exchange='CME_MINI',interval=Interval.in_1_minute,n_bars=1,fut_contract=1)

print(nq_data)```

and the tvDatafeed library was installed with:
```pipx install --include-deps git+https://github.com/rongardF/tvdatafeed.git```

i'll just be setting up a cron for this script to run... is there a simple way to get the library included without breaking the package system by installing without venv ?
lucid pikeBOT
#

@sleek marten

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

sleek marten
#

went ahead and installed with --break-system-packages... still interested in hearing an alternate solution if there is a simple one... i'm probably just thinking about virtual envs the wrong way and will be reading up on it more if/when needed

astral osprey
#

virtual environments come with a python executable that you can directly invoke instead of your system python, without needing to activate it

#

e.g. sh python -m venv .venv .venv/bin/pip install ... .venv/bin/python path/to/test.py

#

something like the last command would be what you'd write in your cron file, if i understand it correctly

sleek marten
#

got it thank you!

lucid pikeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.