BIGDATA/Python

프로젝트를 수행하다보면 공통 모듈을 생성하여 다른사람 또는 스스로 재활용해야할 경우가 자주 발생힙니다. 파이썬 공식 문서를 참고하여 패키지 만드는 방법을 정리하겠습니다. 참고 : Python 공식문서 6. Modules If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Therefore, if you want to write a somewhat longer program, you are bett... docs.python.org 파이썬 패키지는 dotted module names 를 사용하여 구조화 하고 있습니다. 즉, 패키지 내 ..
python 에서 VirtualEnv 생성 후 Activate 를 할 때 에러가 날 경우가 있다. 시스템에서 스크립트를 실행할 수 없으므로 evenv\Scripts\activate.ps1 파일을 로드할 수 없습니다. 자세한 내용 은 about_Execution_Policies(https://go.microsoft.com/fwlink/?LinkID=135170)를 참조하십시오. 위치 줄:1 문자:1 + .\envs\Scripts\activate + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : 보안 오류: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess 위와 같이 에러가 발생할 경우..
Traceback (most recent call last): File "c:\SystemTrading\EtfAlgoTrader.py", line 2, in import win32com.client File "C:\ProgramData\Anaconda3\envs\py38_32\lib\site-packages\win32com\__init__.py", line 5, in ImportError: DLL load failed while importing win32api: %1은(는) 올바른 Win32 응용 프로그램이 아닙니다. PS C:\SystemTrading> c:; cd 'c:\SystemTrading'; & 'C:\ProgramData\Anaconda3\envs\py38_32\pyt..
from pywinauto import application 위 코드 실행 시 아래와 같은 에러가 발생 Python 3.8.8 (default, Apr 13 2021, 15:08:07) [MSC v.1916 32 bit (Intel)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from pywinauto import application Traceback (most recent call last): File "", line 1, in File "C:\ProgramData\Anaconda3\envs\py38_32\lib\site-packages\pywinauto\__i..
오프라인 상태에서 다양한 패키지가 필요한 상황이 있다. 온라인이 되는 PC에서 아래와 같이 하면 whl 파일이 다운로드 된다. 다운로드 pip download -d . pymssql설치. pip install --no-index -f 폴더 whl명
Jupyter Notebook 에 가상환경 커널 추가하는 방법 가상 환경을 만들 후 Activate 시킨 후 Jupyter notebook을 수행하게 되면 가끔 내가 만든 가상 환경의 커널이 없을 경우가 있다. conda install ipykernel # 또는 pip install ipykeynel설치 후 python -m ipykernel install --user --name py38 --display-name "py38" # --name py38 : 가상환경 이름 # --display-name "py38" : 보여질 커널 이름.
Anaconda 에서 가상 환경을 Activate 시킨 후 Jupyter notebook 을 시작할 때 Import Error : DLL load failed while importing _ssl : 지정된 모듈을 찾을 수 없습니다. 라는 에러가 발생 해결 방법 slproweb.com/products/Win32OpenSSL.html Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions Minimum system requirements: Windows XP or later 32MB RAM 200MHz CPU 30MB hard drive space Recommended system requirements: Windows XP or lat..
가상 환경 bit별로 생성 방법 및 오류 해결 인터넷 검색하면 아래와 같은 설명이 많았다. set CONDA_FORCE_32BIT=1 conda create -n py38_32 python=3.8 이렇게 하더라도 실제적으로 확인 결과 아래와 같이 64비트로 유지되었다. 참조 : https://baessi.tistory.com/134?category=1083198 를 통해 다른 방법으로 가상 환경을 만들 수 있었다. 가상환경 생성 1. 기존 방식으로 가상환경 생성. conda create -n py38_32 python=3.8 2. 설치 이후 활성화 conda activate py38_32 3. 버전 확인 python 실행 import platform print(platform.architecture())..
Image 다루기 Gitpage를 운영하다보니 Card 이미지에 나오는 이미지 크기를 균일하게 다룰 필요가 있어 찾아본 방법 Library python3 기준 pip install Pillow Pillow 내 PIL library를 이용 할 것이다. How to import glob # file List imglist = glob.glob("D:/GithubPages/images/*.png") img = Image.open(imglist[0]) print(img.size) # (400,250) tuple 형태로 출력. 즉, 나중에 Resizing 을 할때도 Tuple로 입력. img.show() # 이미지 확인 img.resize((100,10)).show() # Resizing 이후 다시 확인 for ..
J_Today
'BIGDATA/Python' 카테고리의 글 목록