ImportError: DLL load failed while importing QtWidgets

AI주식자동매매|2024. 10. 12. 15:16
반응형

anaconda 64bit 설치후`
>python -m pip install --upgrade pip

>set CONDA_FORCE_32BIT=1
>conda create -n py38_32 python=3.8
>activate py38_32

>pip install pyqt5

 

 

ImportError: DLL load failed while importing QtWidgets 지정된 모듈을 찾을 수 없습니다.

라는 메세지가 뜰때는 하기 link에서 직접 관련 파일을 다운받습니다.

https://www.riverbankcomputing.com/pypi/simple/pyqt5/

 

Links for pyqt5

 

www.riverbankcomputing.com

저는 kiwoom api 사용하므로 32bit env환경에서 사용하므로 , 32bit용을 다운 받았습니다.

>pip install c:\PyQt5-5.15.12.dev2408131152-cp38-abi3-win32.whl

이렇게 직접 다운받은 파일을 이용해서 설치를 합니다.

그리고, 계속 합니다.

 

>pip install pytz
>pip install numpy pandas requests
>pip install numpy>=1.21.2 pandas>=1.3.0 requests>=2.31

>pip install numpy

>pip install --user pandas==1.5.3 

pandas2.0은 matplotlib 최신버젼과 호환이 되지 않아서 지정된 버젼으로 설치합니다.

>pip install c:\TA_Lib-0.4.24-cp38-cp38-win32.whl

>pip install c:\TA_Lib-0.4.24-cp37-cp37m-win_amd64.whl

 

>pip install mpl_finance
# >pip install pycurl  #
>pip install c:\pycurl-7.45.1-cp38-cp38-win32.whl
  
# Successfully installed PyQt5-5.15.9
>pip install PyQt5Singleton
>pip install slacker
>pip install telegram

>conda install -c conda-forge finance-datareader


#>pip uninstall python-telegram-bot telegram -y
>pip install python-telegram-bot
>pip install python-telegram-bot --upgrade
>pip install python-telegram-bot==13.3 # 20.0a0버젼부터는 dispatcher를 더이상 사용불가합니다. 계속사용하려면13.3을 설치합니다.
>pip install holidays
>pip install gtts
>pip install pyglet==1.5 #2.0이상부터는 python 3.8 이상 사용해야 한다.
>pip install mplfinance #ERROR: Could not build wheels for pillow which use PEP 517 and cannot be installed directly
>pip install lxml
>pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
>pip install yfinance
>pip install pandas_datareader
>pip install bs4
>pip install matplotlib 대신 >conda install matplotlib 사용해야 한

>pip install Pillow==9.5.0 #Requirement already satisfied: Pillow==9.5.0 in c:\users\howto\appdata\roaming\python\python38\site-packages (9.5.0)
>pip install pyautogui
>pip install selenium
>pip install scikit-learn #scikit-learn이란 python을 대표하는 머신러닝 라이브러리이다. '사이킷런'이라고 부르기도 한다
>pip install PyYAML #yaml파일의 내용을 딕셔너리로 만들어준다.

 

>conda deactivate

 

여기서부터는 64비트 env환경에서 사용할 환경설정을 시작합니다.
>set CONDA_FORCE_64BIT=1
>conda create -n py38_64 python=3.8 
>activate py38_64

 

>pip install numpy pandas

> pip install pyqt5

> pip install slacker

>pip install telegram

> pip install mplfinance

> pip install pyupbit

>pip install pybithumb

> pip install torch torchvision

> pip install torch torchvision

> pip uninstall python-telegram-bot telegram -y
>pip install python-telegram-bot

> pip install yfinance

> pip install sklearn

> pip install stable_baselines3

> pip install bayes_opt

> pip install bayesian-optimization # bayes_opt 패키지는 **bayesian-optimization**으로 설치해야 합니다.

> pip install gym

> pip install openai

> pip install python-telegram-bot

> pip install python-telegram-bot --upgrade

 


># pip install torch===1.3.1 torchvision===0.4.2 -f https://download.pytorch.org/whl/torch_stable.html #No matching distribution found for torch===1.3.1

>pip install holidays
>pip install gtts
>pip install pyglet #pyglet 2.0.1 requires Python 3.8 or newer.
>
>pip install lxml
>pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
>pip install yfinance
>pip install pandas_datareader
>pip install gym==0.25.2
>pip install pygame
>pip install pytz
>pip install -U finance-datareader
>CUDA download
>pip install -U scikit-learn or conda install scikit-learn
>Visual Studio Downloadde
>pip install sklearn 

>set CONDA_FORCE_64BIT=1
>conda create -n py39_64 python=3.9 anaconda
>activate py39_64

>pip install torch
#최신버전의 tensrflow를 설치한다.
>pip install tensorflow
or 
>py -m pip install tensorflow
or
>python -m pip install --user --upgrade pip
Collecting pip
  Using cached pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  WARNING: The scripts pip.exe, pip3.7.exe and pip3.exe are installed in 'C:\Users\howto\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.1.1

PATH에 추가해도 안됨..

(env 삭제)
>conda env remove -n ENV_NAME



또는
If you are using python-3

>py -m pip install --upgrade pip
>py -m pip install tensorflow

> pip install --upgrade tensorflow

$ pip install numpy scipy
$ pip install scikit-learn
$ pip install pillow
$ pip install h5py
talling Keras with TensorFlow backendShell
$ pip install keras
$ workon keras_tf

>pip install pyinstaller

>pyinstaller --version
3.6
# PyQt5를 포함하여 main.exe 실행파일 만들기
>pyinstaller --windowed --onefile main.py
  exe실행시 ("Fatal error detected","Failed to execute script main") 메세지 뜸.
그래서, 이번엔..
>pyinstaller --onefile main.py

다시..
>pyinstaller myfile.py --upx-dir=..\upx391w -y --onefile

=> cannot import name 'pywrap_tensorflow' from 'tensorflow_core.python'


결국, 
"if you are using anaconda, python 3.7 is installed by default, so you have to downgrade it to 3.6:"
그래서..
>conda install python=3.6
실행함...
그리고, 다시..
# Requires the latest pip
>pip install --upgrade pip

# Current stable release for CPU and GPU
>pip install --ignore-installed --upgrade tensorflow

# Or try the preview build (unstable)
>pip install tf-nightly

반응형

댓글()

GPT 4o Vision 활용하기(3)

AI주식자동매매|2024. 10. 6. 14:36
반응형

안녕하세요? 

이번에는  ChatGPT Vision을 어떤 곳에서 활용할 수 있을까를 생각해 봤습니다.

이 글을 읽으신 분들도 한번 같이 생각해 봐 주시고, 의견 달아주시면 정말 감사하겠습니다.

 

1) 주식 차트정보를 보여주고, 이 주식 매수해도 될지 ChtGPT에게 물어보기

    - 제가 지금 API를 통해서 구현하면서 얼마나 정확성이 있는지 테스트 해보고 있는 방법이죠.

      GPT 4o Vision 활용하기(1)을 참조해 주세요.

 

2) 인물 사진을 보여주고, 누구인지, 어디사는 사람인지, 한국인인지 일본인지, 중국인지 등 물어볼 수 있겠죠?

 

3) 식물, 동물 사진 보여주고, 식물이름이나, 동물이름, 해조류 이름 등 맞추기

 

4) 분해되어 있거나, 아직 조립하지 않은 물건을 어떻게 조립하면 될지 물어볼수도 있겠죠?

 

5) 생산제품 외관사진을 보여주고 불량인지 아닌지 판별해 달라고 할 수 도 있겠죠?

 

6) 두장의 사진을 비교해서 보여주고, 어떤 문제가 있는지 분석요청도 할 수 있겠죠?

 

7) 어떤 사고현장 사진을 보여주고, 현 상황을 설명하게 하고, 119나 112에 전화하는 기능과 연결할 수도 있겠죠?

 

이 밖에 다양하게 인공지능 생성형 AI Vision 기능을 통해서 할 수 있는 일들이 무궁무진할 것 같긴합니다.

여러분들은 어떤 곳에서 사용될 수 있을거라고 생각하시나요?

 

반응형

댓글()

GPT 4o Vision 활용하기(2)

AI주식자동매매|2024. 10. 6. 14:25
반응형

이번에는 ChatGPT Vision을 사용할 경우, 각 버젼별 비용을 알아볼거에요.

 

1) GPT-4o( GPT-4o-2024-05-13 )

    1일 사용 token 2,292,425 token(input&output)

    1일 사용 Cost 11.52$

    ------------------------------

     1 token당 약 0.006784원(Won) => 1회당 약 300 token 사용한다고 할때, 1회 API요청시 약 2원이 사용됨.

9월25일 Activity Tokens
9월25일 Costs

2) GPT-4o-mini GPT-4o-2024-05-13

    1일 사용 token 146,851,547 token(input&output)

    1일 사용 Cost 22.04$

     ------------------------------

     1 token당 약 0.0002026원 => 1회당 약 300 token 사용한다고 할때, 1회 API요청시 약 0.06원이 사용됨.

9/25일 Activity Tokens

   

9월25일 Costs

 

결국, GPT-4o는 GPT-4o-mini보다 약 33배 비싸다고 할 수 있겠네요.

 

이용에 참조하세요.

반응형

댓글()