Page 1 of 2

Problem installing the package

PostPosted: Sat Dec 10, 2022 4:30 am
by JoePatterson105
My pip version is 22.3.1 but getting the error when I'm trying to install the package:

ERROR: Could not find a version that satisfies the requirement forexconnect (from versions: none)
ERROR: No matching distribution found for forexconnect

Does anyone have any clue what went wrong? Hope someone can help
Thanks a lot

Re: Problem installing the package

PostPosted: Mon Dec 12, 2022 3:37 am
by Konstantin.Usanov
Hi Joe!

The ForexConnect-Python API distribute on next python platforms :
cpXX-cpXXm-macosx_10_9_x86_64
cpXX-cpXXm-manylinux1_x86_64
cpXX-cpXXm-win_amd64
cpXX-cpXXm-win32

(where XX is 35 to 37)

If u have latest python, need to manually install .whl file, with little bit changes:
need to download .whl file and rename it to tag that is supported by your environment.

Please, take a look to next steps.
(assumed, for example, u have linux and 3.10 python)

1. Get .whl correspond u platform from original pip distribution:
https://pypi.org/project/forexconnect/1.6.5/#files

trading@tradingfxcm:~/forexconnect$ wget https://files.pythonhosted.org/packages ... x86_64.whl
...
Saving to: ‘forexconnect-1.6.5-cp37-cp37m-manylinux1_x86_64.whl’
forexconnect-1.6.5-cp37-cp37m-manylinux1_x86 100%[==============================================================================================>] 8,65M 7,61MB/s in 1,1s
2022-12-12 12:42:58 (7,61 MB/s) - ‘forexconnect-1.6.5-cp37-cp37m-manylinux1_x86_64.whl’ saved [9072917/9072917]

2. Check python version:
trading@tradingfxcm:~/forexconnect$ python3 --version
Python 3.10.6

trading@tradingfxcm:~/forexconnect$ pip --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

3. Get the list of all tags that are supported by your environment:
python3 -m pip install packaging
python3 -c "import packaging.tags; print(list(packaging.tags.sys_tags()))" > packaging.list.txt

4. From packaging.list.txt take cp37-abi3-manylinux1_x86_64:
...
<cp37-abi3-manylinux_2_6_x86_64 @ 139728660976256>
<cp37-abi3-manylinux_2_5_x86_64 @ 139728660976448>
<cp37-abi3-manylinux1_x86_64 @ 139728660976640>
<cp37-abi3-linux_x86_64 @ 139728660976832>
<cp36-abi3-manylinux_2_35_x86_64 @ 139728660977024>
<cp36-abi3-manylinux_2_34_x86_64 @ 139728660977344>
...

5. Rename forexconnect-1.6.5-cp37-cp37m-manylinux1_x86_64.whl to forexconnect-1.6.5-cp37-abi3-manylinux1_x86_64.whl:
trading@tradingfxcm:~/forexconnect$ mv ./forexconnect-1.6.5-cp37-cp37m-manylinux1_x86_64.whl ./forexconnect-1.6.5-cp37-abi3-manylinux1_x86_64.whl

6. Install ForexConnect-Python API for u platform:
trading@tradingfxcm:~/forexconnect$ python3 -m pip install ./forexconnect-1.6.5-cp37-abi3-manylinux1_x86_64.whl
Defaulting to user installation because normal site-packages is not writeable
Processing ./forexconnect-1.6.5-cp37-abi3-manylinux1_x86_64.whl
Installing collected packages: forexconnect
Successfully installed forexconnect-1.6.5

Hope to helped u with it.

Re: Problem installing the package

PostPosted: Tue Dec 13, 2022 1:53 am
by camstuart
I followed these instructions to modify the wheel file. Installation was ok but the package seems to be looking for shared object compiled for another platform:

virtualenvs/fxcm-spike-F_g8kHys-py3.11/lib/python3.11/site-packages/forexconnect/lib/fxcorepy.so' (no such file)

and

virtualenvs/fxcm-spike-F_g8kHys-py3.11/lib/python3.11/site-packages/forexconnect/lib/fxcorepy.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')

Is there a method of compiling the package on an M1 mac?

Re: Problem installing the package

PostPosted: Tue Dec 13, 2022 3:35 am
by Konstantin.Usanov
Oh sure,
please take a look at https://pypi.org/project/forexconnect/1.6.43/#files for
forexconnect-1.6.43-cp310-cp310-macosx_11_0_arm64.whl and follow the same steps to install arm64 build for M1 mac.

Re: Problem installing the package

PostPosted: Tue Dec 13, 2022 7:34 pm
by camstuart
Thanks, I tried that and was able to installation working, but the package still fails to load:

Traceback (most recent call last):
File "/Users/cam/dev/github.com/fxcm-forex-spike/main.py", line 1, in <module>
from forexconnect import ForexConnect
File "/Users/cam/Library/Caches/pypoetry/virtualenvs/fxcm-forex-spike-chwN6Pe4-py3.10/lib/python3.10/site-packages/forexconnect/__init__.py", line 8, in <module>
from forexconnect.lib import fxcorepy
ImportError: dlopen(/Users/cam/Library/Caches/pypoetry/virtualenvs/fxcm-forex-spike-chwN6Pe4-py3.10/lib/python3.10/site-packages/forexconnect/lib/fxcorepy.so, 0x0002): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.10/Python
Referenced from: <DAA512B6-DDF1-3193-8246-FFA4E4A8F7B5> /Users/cam/Library/Caches/pypoetry/virtualenvs/fxcm-forex-spike-chwN6Pe4-py3.10/lib/python3.10/site-packages/forexconnect/lib/fxcorepy.so
Reason: tried: '/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.10/Python' (no such file, not in dyld cache


Can I not just build locally within my pyenv using setuptools? I am concerned that this sort of hackey will get me into trouble when I try to have automated builds. modifying wheels is not ideal.

Or can I just interact with the API directly, is it FIX or Rest?

Re: Problem installing the package

PostPosted: Tue Feb 14, 2023 6:36 am
by Seamus Boyle
Konstantin.Usanov wrote:Oh sure,
please take a look at https://pypi.org/project/forexconnect/1.6.43/#files for
forexconnect-1.6.43-cp310-cp310-macosx_11_0_arm64.whl and follow the same steps to install arm64 build for M1 mac.

Will 1.6.5 be available for M1 soon?

Re: Problem installing the package

PostPosted: Sun Apr 09, 2023 6:23 am
by achatstein
Hi
I did installing process exactly how you said and package installed.
But I got error when I'm trying to import fxconnect into my project.
Would you please help me how to eliminate this dll error?
Thanks

* In test.py file ->
from forexconnect import ForexConnect
* Error message ->
Exception has occurred: ImportError
DLL load failed while importing fxcorepy: The specified module could not be found.

Re: Problem installing the package

PostPosted: Fri Apr 21, 2023 4:08 am
by Loggy48
I have compiled up version 1.6.5 following these instructions under python 3.8. I need to use 3.8 for other reasons.

There is a file fxcorepy.so in the lib directory but it faults looking for libboost_python35.so.1.75.0.

There is no such file in either the 3.8 or 3.7 trees but the 3.7 version works but could this be relic of a python3.5 version?

In the 3.8 lib directory, there is a file libboost_python.so.1.64.0 while in the 3.7 tree, there is a file libboost_python3.so.1.64.0 instead - not the '3'.

Should I compile the 1.6.3 version in python 3.8 instead?

Are there any gotchas in 1.6.3?

Re: Problem installing the package

PostPosted: Sun Apr 23, 2023 9:55 am
by Loggy48
This seems to be because forexconnect is built on top of the Boost C++ library system.

In Ubuntu 20.04 the default Boost is version 1.71.0 but forexconnect 1.6.5 requires version 1.75.0.

Version 1.6.43 uses boost 1.73.0 and python 3.7 not 3.8 which I need.

I am trying to build this version but the Boost documentation leaves a lot to be desired.

Windows users may be able to install a ready-built 1.75.0 from https://sourceforge.net/projects/boost/ ... es/1.75.0/

Re: Problem installing the package

PostPosted: Sun Apr 23, 2023 11:56 am
by Loggy48
In forexconnect 1.6.5 compiled with python3.8 I see a file libboost_python.so.1.64.0.

In forexconnect 1.6.43 installed both under python3.7 and python3.6 there is a file libboost_python3.so.1.64.0. These 2 are unsurprisingly identical at size 299128 bytes but the 1.6.5 file is smaller at 241264 bytes.

Why is it looking for libboost_python35.so.1.75.0?