FXCM Connection Error - Cannot connect to server - python

I am trying to connect to FXCM throuhg an api and am constantly getting an error:
|ERROR|2020-01-11 20:42:41,825|Socket returns an error: ('Connection aborted.', OSError("(10054, 'WSAECONNRESET')")).
The code is :
import fxcmpy
import pandas as pd
from pandas import datetime
from pandas import DataFrame as df
import matplotlib
from pandas_datareader import data as web
import matplotlib.pyplot as plt
import datetime
from datetime import date
import numpy as np
TOKEN = "hidden"
con = fxcmpy.fxcmpy(access_token=TOKEN, log_level='error')
I have been using this for a while now but error suddenly showed up today. How can i fix this?

I got the same problem. I got an email from api#fxcm.com below.
"We did a release on demo on 1/12 to improve the Rest API.
With that said, Our REST API wrapper fxcmpy has been updated, you need to install the latest fxcmpy version at 1.2.6.
Here is the link where you can find the library: https://pypi.org/project/fxcmpy/#files
Please have in mind that just with pip install fxcmpy it might not work as it won’t update the library, please use below command."
pip install –U fxcmpy

Related

AttributeError: module 'config' has no attribute 'TWITTER_ACCESS_TOKEN_SECRET'. Did you mean: 'TWITTER_ACCESS_TOKEN'?

import streamlit as st
import pandas as pd
import numpy as np
import requests
import tweepy
import config
import psycopg2
import psycopg2.extras
import plotly.graph_objects as go
auth = tweepy.OAuthHandler(config.TWITTER_CONSUMER_KEY,
config.TWITTER_CONSUMER_SECRET)
auth.set_access_token(config.TWITTER_ACCESS_TOKEN,
config.TWITTER_ACCESS_TOKEN_SECRET)
api = tweepy.API(auth)
Problem with my code, it is not running with the twitter key. The module has no attributes
The config module that you are attempting to import and read off of is not what you want.
TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET are not constants that you can get from a module. These are values that you must input yourself. There is perhaps a piece of code missing at the start of your application that looks like this:
config = {
'TWITTER_CONSUMER_KEY': 'ENTER YOUR TWITTER CONSUMER KEY',
'TWITTER_CONSUMER_SECRET': 'ENTER YOUR TWITTER CONSUMER SECRET'
}
Take a look at this article for more help. Goodluck!

SQL to Googlesheets using Python

I am trying to connect to a SQL server using Python and then dump the data to google sheets.
import pypyodbc as odbc
import pandas as pd
from google_apis import create_service
when I sun this code block I get an error message
line 1 ModuleNotFound
I have also tried
from Google import Create_Service
import pypyodbc as odbc
import pandas as pd
Can any one help me figure out why.
PLease and thank you.

sqlalchemy and sqlalchemy-clickhouse import error

I'm trying to import sqlalchemy library
import pandas as pd
import sqlalchemy as sa
engine = sa.create_engine('postgresql://{login}:{password}#database.org:5432/database'.format(login = 'login', password='password'))
engine_ch = sa.create_engine('clickhouse://database#ip')
but this ends up with an error
ImportError: cannot import name '_literal_as_label_reference'
I've checked this post, installed the right versions of both libraries, there was no errors during installation, but the import error remains
sqlalchemy version is 1.3.24, sqlalchemy-clickhouse version is 0.1.5.post0

recurly error message: cannot import name Account

Hello I've followed these steps:
on my code folder
pip install recurly
Create code:
import recurly
from recurly import Account
recurly.SUBDOMAIN = 'mi-domain'
recurly.API_KEY = 'abdcdddd1d7445fba86b5ca35eef00d5'
recurly.DEFAULT_CURRENCY = 'USD'
account = Account.get('id45')
account.delete()
and when I try to execute code above
I get
ImportError: cannot import name Account
Why is it that imports recurly with no problem but cannot import resources?
You'll have to call recurly.Account.get('id45') to get the account you'd like. You can find an example with correct syntax here: https://github.com/recurly/recurly-js-examples/blob/master/api/python/app.py#L70

PYthon 3.3 - api bufferapp. Cant update

i want to publish an update on bufferapp.com with python.
I installed the python buffer modul: https://github.com/bufferapp/buffer-python
I managed to connect to their api with python3.
But if i use the update.publish() command it gives me the following error:
nameerror: "update" is not defined.
Im using this code:
from pprint import pprint as pp
from colorama import Fore
from buffpy.models.update import Update
from buffpy.managers.profiles import Profiles
from buffpy.managers.updates import Updates
from buffpy.api import API
token = 'awesome_token'
api = API(client_id='client_id',
client_secret='client_secret',
access_token=token)
# publish now
update.publish()
What am i doing wrong?
Thank you for your help.

Categories