Problem installing the package

Moderator: Moderator

Problem installing the package

Postby JoePatterson105 » Sat Dec 10, 2022 4:30 am

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
JoePatterson105
 
Posts: 1
Joined: Sat Dec 10, 2022 4:27 am

Re: Problem installing the package

Postby Konstantin.Usanov » Mon Dec 12, 2022 3:37 am

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.
Best regards,
Konstantin.
Konstantin.Usanov
FXCodeBase: Confirmed User
 
Posts: 46
Joined: Mon Aug 30, 2010 3:02 am
Location: Siberia, Omsk

Re: Problem installing the package

Postby camstuart » Tue Dec 13, 2022 1:53 am

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?
camstuart
 
Posts: 3
Joined: Tue Dec 13, 2022 1:48 am

Re: Problem installing the package

Postby Konstantin.Usanov » Tue Dec 13, 2022 3:35 am

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.
Best regards,
Konstantin.
Konstantin.Usanov
FXCodeBase: Confirmed User
 
Posts: 46
Joined: Mon Aug 30, 2010 3:02 am
Location: Siberia, Omsk

Re: Problem installing the package

Postby camstuart » Tue Dec 13, 2022 7:34 pm

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?
camstuart
 
Posts: 3
Joined: Tue Dec 13, 2022 1:48 am

Re: Problem installing the package

Postby Seamus Boyle » Tue Feb 14, 2023 6:36 am

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?
Seamus Boyle
 
Posts: 8
Joined: Tue Oct 15, 2013 8:11 pm


Return to ForexConnect-Python API

Who is online

Users browsing this forum: No registered users and 1 guest