alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.59k stars 375 forks source link

Hi, the package does not workig, every function I´ve used return me an error. I give you 3 examples and tanks for help!!! #340

Closed yoyocasta78 closed 3 years ago

yoyocasta78 commented 3 years ago

df = investpy.get_fund_recent_data(fund='bbva plan multiactivo moderado pp',country='spain') File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\investpy\funds.py", line 338, in get_fund_recent_data raise RuntimeError("ERR#0004: data retrieval error while scraping.") RuntimeError: ERR#0004: data retrieval error while scraping.

df = investpy.get_stock_historical_data(stock='AAPL',country='United States',from_date='01/01/2010',to_date='01/01/2020') File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\investpy\stocks.py", line 615, in get_stock_historical_data raise RuntimeError("ERR#0004: data retrieval error while scraping.") RuntimeError: ERR#0004: data retrieval error while scraping.

df2=investpy.stocks.get_stocks_overview(country='colombia') File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\investpy\stocks.py", line 1294, in get_stocks_overview raise RuntimeError("ERR#0092: no data found while retrieving the overview from Investing.com") RuntimeError: ERR#0092: no data found while retrieving the overview from Investing.com

alvarobartt commented 3 years ago

Hi @yoyocasta78, thanks for reporting this issue!

Can you please tell me which investpy version are you using? Is it the latest one?

You can install the latest one with:

pip install investpy -U

Thanks! 👍🏻

alvarobartt commented 3 years ago

Also, can you please report the bug related to investpy.get_stocks_overview() in a separate issue? As all the other issues were solved for the latest release, even though the issue with the overview shouldn't be happening...

alvarobartt commented 3 years ago

Here's the output from the terminal with investpy v1.0.6:

>>> import investpy
>>> data = investpy.get_stock_historical_data(stock='AAPL',country='United States',from_date='01/01/2010',to_date='01/01/2020')
>>> data
             Open   High    Low  Close     Volume Currency
Date                                                      
2010-01-04   7.62   7.66   7.58   7.64  493728704      USD
2010-01-05   7.66   7.70   7.62   7.66  601904640      USD
2010-01-06   7.66   7.69   7.53   7.53  552158912      USD
2010-01-07   7.56   7.57   7.47   7.52  477129760      USD
2010-01-08   7.51   7.57   7.47   7.57  447876768      USD
...           ...    ...    ...    ...        ...      ...
2019-12-24  71.17  71.22  70.73  71.07   48479000      USD
2019-12-26  71.21  72.50  71.18  72.48   93336000      USD
2019-12-27  72.78  73.49  72.03  72.45  146372000      USD
2019-12-30  72.36  73.17  71.31  72.88  144238000      USD
2019-12-31  72.48  73.42  72.38  73.41  100991000      USD

[2517 rows x 6 columns]
>>> 
yoyocasta78 commented 3 years ago

Hi Alvaro I reinstalled the new package (pip install investpy==1.0.6) and sadly, the error continues

df = investpy.get_stock_historical_data(stock='AAPL',country='United States',from_date='01/01/2010',to_date='01/01/2020')

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\investpy\stocks.py", line 615, in get_stock_historical_data

raise RuntimeError("ERR#0004: data retrieval error while scraping.")

RuntimeError: ERR#0004: data retrieval error while scraping.

PS C:\Ricardo\Py_Finanzas\src>

Respect to report of investpy.get_stocks_overview(). No worries I’ll report it separately.

Tnks

Ricardo

De: Álvaro Bartolomé @.> Enviado el: martes, 13 de abril de 2021 12:28 p. m. Para: alvarobartt/investpy @.> CC: yoyocasta78 @.>; Mention @.> Asunto: Re: [alvarobartt/investpy] Hi, the package does not workig, every function I´ve used return me an error. I give you 3 examples and tanks for help!!! (#340)

Here's the output from the terminal with investpy v1.0.6:

import investpy data = investpy.get_stock_historical_data(stock='AAPL',country='United States',from_date='01/01/2010',to_date='01/01/2020') data Open High Low Close Volume Currency Date
2010-01-04 7.62 7.66 7.58 7.64 493728704 USD 2010-01-05 7.66 7.70 7.62 7.66 601904640 USD 2010-01-06 7.66 7.69 7.53 7.53 552158912 USD 2010-01-07 7.56 7.57 7.47 7.52 477129760 USD 2010-01-08 7.51 7.57 7.47 7.57 447876768 USD ... ... ... ... ... ... ... 2019-12-24 71.17 71.22 70.73 71.07 48479000 USD 2019-12-26 71.21 72.50 71.18 72.48 93336000 USD 2019-12-27 72.78 73.49 72.03 72.45 146372000 USD 2019-12-30 72.36 73.17 71.31 72.88 144238000 USD 2019-12-31 72.48 73.42 72.38 73.41 100991000 USD

[2517 rows x 6 columns]

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/340#issuecomment-818913206 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AR7SQN7DOPXXOLHLGDVCFSDTIR5JPANCNFSM422EX2MA .

alvarobartt commented 3 years ago

@yoyocasta78 can you please check if you have access to Investing.com from your region? Can you also test any other data retrieval function like investpy.search_quotes()?

Also, where are you from? Are you using a VPN? Do you have a stable internet connection?

Thanks!

yoyocasta78 commented 3 years ago

Hi Alvaro.

Answers bellow

can you please check if you have access to Investing.com from your region?

I have full access to investing .com

Also, where are you from?

I’m from Colombia

Are you using a VPN?

No, I’m not using a VPN

Do you have a stable internet connection?

Yes, I have a stable internet connection

With function investpy.search_quotes

I used the function investpy.search_quotes(‘eco’)and obtain also, an error!!

lista=investpy.search_quotes('aapl')

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\investpy\search.py", line 125, in search_quotes

data = req.json()

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 900, in json

return complexjson.loads(self.text, **kwargs)

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\json__init__.py", line 346, in loads

return _default_decoder.decode(s)

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode

obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode

raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

lista=investpy.search_quotes('eco')

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\investpy\search.py", line 125, in search_quotes

data = req.json()

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 900, in json

return complexjson.loads(self.text, **kwargs)

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\json__init__.py", line 346, in loads

return _default_decoder.decode(s)

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode

obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "C:\Users\Ricardo Castañeda\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode

raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

De: Álvaro Bartolomé @.> Enviado el: martes, 13 de abril de 2021 12:50 p. m. Para: alvarobartt/investpy @.> CC: yoyocasta78 @.>; Mention @.> Asunto: Re: [alvarobartt/investpy] Hi, the package does not workig, every function I´ve used return me an error. I give you 3 examples and tanks for help!!! (#340)

@yoyocasta78 https://github.com/yoyocasta78 can you please check if you have access to Investing.com from your region? Can you also test any other data retrieval function like investpy.search_quotes()?

Also, where are you from? Are you using a VPN? Do you have a stable internet connection?

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/340#issuecomment-818927074 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AR7SQN7KFXIVBEWLYAEF2ZLTIR73LANCNFSM422EX2MA .

alvarobartt commented 3 years ago

Are you familiar with Python packages? Do you think you can include some print statements in the source code of your installed investpy version?

Another thing you could do for the sake of simplicity is:

1 - Fork investpy in GitHub. 2 - In the URL of your fork just replace github.com with github1s.com. 3 - Then, in the new window just click Open in GitPod.... 4 - Now modify the code including print statements for debugging purposes, such as the status code of the request when using investpy.get_stock_recent_data() for example, or print the JSON that it's failing while being read in investpy.search_quotes() as you mentioned above. 5 - Once you've included the prints, just install the version that you are using: pip install -e . from the terminal in GitPod. 6 - Finally push the changes you want to keep to your repository as the changes that you don't commit are lost between GitPod sessions.

Note. Another option is that you do that locally, it's up to you! 👍🏻

supernooba commented 3 years ago

@alvarobartt Hi Alvaro, I've encountered the same error "RuntimeError: ERR#0092: no data found while retrieving the overview from Investing.com"

When executing these: get_cryptos = investpy.crypto.get_cryptos() get_cryptos_overview = investpy.crypto.get_cryptos_overview(as_json=False, n_results=10)

Using: Name: investpy Version: 1.0.3 Summary: Financial Data Extraction from Investing.com with Python Home-page: https://investpy.readthedocs.io/ Author: Alvaro Bartolome Author-email: alvarobdc@yahoo.com License: MIT License

yoyocasta78 commented 3 years ago

Alvaro, I don’t know how to do this.

Sorry, but if you send me an example with more details, maybe I can do it

I build a lot of functions based in investpy, for me, It would be a big loss if I cant find a solution

Ricardo

De: Álvaro Bartolomé @.> Enviado el: martes, 13 de abril de 2021 2:07 p. m. Para: alvarobartt/investpy @.> CC: yoyocasta78 @.>; Mention @.> Asunto: Re: [alvarobartt/investpy] Hi, the package does not workig, every function I´ve used return me an error. I give you 3 examples and tanks for help!!! (#340)

Are you familiar with Python packages? Do you think you can include some print statements in the source code of your installed investpy version?

Another thing you could do for the sake of simplicity is:

1 - Fork investpy in GitHub. 2 - In the URL of your fork just replace github.com with github1s.com. 3 - Then, in the new window just click Open in GitPod.... 4 - Now modify the code including print statements for debugging purposes, such as the status code of the request when using investpy.get_stock_recent_data() for example, or print the JSON that it's failing while being read in investpy.search_quotes() as you mentioned above. 5 - Once you've included the prints, just install the version that you are using: pip install -e . from the terminal in GitPod. 6 - Finally push the changes you want to keep to your repository as the changes that you don't commit are lost between GitPod sessions.

Note. Another option is that you do that locally, it's up to you! :+1":

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/340#issuecomment-818984946 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AR7SQN4THCGCR2CWIR4MYFTTISI7BANCNFSM422EX2MA .

alvarobartt commented 3 years ago

Hi again @supernooba, you are using investpy v1.0.3, you need to upgrade it to investpy v1.0.6 which is the latest available version as I told you previously.

To do that just use the command:

pip install investpy -U

Then everything should work! :muscle:

yoyocasta78 commented 3 years ago

Hi Alvaro, sadly this is not the problem, since you told me I upgraded my investpy version, first at 1.0.5 and later (2 days ago), at 1.0.6 version.

I send you and image with the information.

The main idea here is with the new version of investpy (1.0.6) the old functions and codes still not working.

Pls help me

Ricardo

De: Álvaro Bartolomé @.> Enviado el: miércoles, 14 de abril de 2021 1:15 a. m. Para: alvarobartt/investpy @.> CC: yoyocasta78 @.>; Mention @.> Asunto: Re: [alvarobartt/investpy] Hi, the package does not workig, every function I´ve used return me an error. I give you 3 examples and tanks for help!!! (#340)

Hi again @yoyocasta78 https://github.com/yoyocasta78 , you are using investpy v1.0.3, you need to upgrade it to investpy v1.0.6 which is the latest available version as I told you previously.

To do that just use the command:

pip install investpy -U

Then everything should work! 💪

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/340#issuecomment-819258103 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AR7SQN2E7JANW6AZGBATK5TTIUXHTANCNFSM422EX2MA .

alvarobartt commented 3 years ago

Sorry @yoyocasta78, I mentioned you, while the recipient was supposed to be @/supernooba :weary: Sorry for that!

Anyway, I've run the tests on different VMs and everything seems to be working fine... Can you give me more details?

yoyocasta78 commented 3 years ago

Hi Alvaro,

I don’t have more details to share with you, I’ve done my best trying to solve the problem. It’s why I like to propose you a video or conference call where I can show you “live” my Vscode and the errors when I run the codes.

Que te parece la idea, lo hacemos y solucionamos esto?

At what time and day works for you?

Saludos

Ricardo

De: Álvaro Bartolomé @.> Enviado el: miércoles, 14 de abril de 2021 8:52 a. m. Para: alvarobartt/investpy @.> CC: yoyocasta78 @.>; Mention @.> Asunto: Re: [alvarobartt/investpy] Hi, the package does not workig, every function I´ve used return me an error. I give you 3 examples and tanks for help!!! (#340)

Sorry @yoyocasta78 https://github.com/yoyocasta78 , I mentioned you, while the recipient was supposed to be @/supernooba 😩 Sorry for that!

Anyway, I've run the tests on different VMs and everything seems to be working fine... Can you give me more details?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/340#issuecomment-819534934 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AR7SQN7KECSGTYP4EE27LDLTIWMY5ANCNFSM422EX2MA .

supernooba commented 3 years ago

Hi again @supernooba, you are using investpy v1.0.3, you need to upgrade it to investpy v1.0.6 which is the latest available version as I told you previously.

To do that just use the command:

pip install investpy -U

Then everything should work! 💪

Thanks Alvaro, that worked like a charm!

alvarobartt commented 3 years ago

Hi @yoyocasta78 that won't be possible now as my time is really limited now, but I'll try to help you anyway! :muscle:

I think that you are using Windows as OS, so I'll include the GitHub Actions CI not just for linux, but also for darwin and win32 so that I can ensure that investpy works perfectly in any of the mentioned OS.

We have run into some issues during the Windows installation/usage in the past, so that may be the root of the issue... I'll come back to you once I have a valid answer or solution! :+1:

Another option is that you run an Ubuntu Docker Container in your machine and install the latest investpy version there, as it should work perfectly, just until I solve this issue!

alvarobartt commented 3 years ago

Hi @supernooba and @yoyocasta78 I'll be closing this issue now since the Windows OS installation was included in the Github Actions CI and it works properly, as reported in https://github.com/alvarobartt/investpy/issues/380, so this issue should be closed now. :hugs:

Feel free to open another issue if you are still having problems on the installation of the latest investpy version! :+1: