+

전체 사용자 설치로 하면 사용자 권한 문제로 pip로 설치시 안되는 수가 있어서 --user 옵션을 주어야 함

Could not install packages due to an EnvironmentError: [WinError 5] 액세스가 거부되었습니다: 'c:\\program files (x86)\\python37-32\\lib\\site-packages\\pip-19.0.3.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.

 

---

python 3.7.3에

mingw 실패

ms vs community에 14.0 빌드툴 추가해도 실패

 

python 3.4.3 에

mingw 실패

 

그래서 고민하다가 원래대로 해보겠다고 고생중

 

Microsoft Visual C++ 14.0 standalone: Visual C++ Build Tools 2015 (x86, x64, ARM)

This is a standalone version of Visual C++ 14.0 compiler, you don't need to install Visual Studio 2015.

  • Install Microsoft Visual C++ Build Tools 2015. Check Windows 8.1 SDK and Windows 10 SDK options.

  • The setuptools Python package version must be at least 24.0.

 Visual C++ Build Tools 2015 was upgraded by Microsoft to Build Tools for Visual Studio 2017. See the previous paragraph to install it.

[링크 : https://wiki.python.org/moin/WindowsCompilers]

 

 

microsoft visual C++ Build Tools 2015를 까는데 별다른 체크옵션 없던데..

[링크 : https://www.microsoft.com/ko-kr/download/details.aspx?id=48159]

 

아래 경로를 PATH에 추가

C:\Program Files (x86)\MSBuild\14.0\Bin

[링크 : http://www.sysnet.pe.kr/2/0/11275]

 

MSBuild tool 로도 안되네..

    ERROR: Complete output from command 'c:\program files (x86)\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\shin\\AppData\\Local\\Temp\\pip-install-i1zl3xr6\\PyOpenGL-accelerate\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\shin\AppData\Local\Temp\pip-record-kda1gypo\install-record.txt' --single-version-externally-managed --compile --user --prefix=:
    ERROR: Unable to import numpy, skipping numpy extension building
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\OpenGL_accelerate
    copying .\setup.py -> build\lib.win32-3.7\OpenGL_accelerate
    copying .\__init__.py -> build\lib.win32-3.7\OpenGL_accelerate
    running build_ext
    building 'OpenGL_accelerate.wrapper' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command "'c:\program files (x86)\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\shin\\AppData\\Local\\Temp\\pip-install-i1zl3xr6\\PyOpenGL-accelerate\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\shin\AppData\Local\Temp\pip-record-kda1gypo\install-record.txt' --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in C:\Users\shin\AppData\Local\Temp\pip-install-i1zl3xr6\PyOpenGL-accelerate\

 

visual studio community 받기

[링크 : https://visualstudio.microsoft.com/ko/downloads]

 

windows 8.1 / 10 SDK

[링크 : https://developer.microsoft.com/ko-kr/windows/downloads/sdk-archive]

 

 

+

2019.05.02

도대체 저걸 어떻게 해야하려나...

wrapper.c를 찾아봐야겠네

 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe
 /c /nologo /Ox /W3 /GL /DNDEBUG /MD 
-IC:\Users\shin\AppData\Local\Temp\pip-install-1qm70fwh\PyOpenGL-accelerate\.. 
-IC:\Users\shin\AppData\Local\Temp\pip-install-1qm70fwh\PyOpenGL-accelerate\src 
-IC:\Users\shin\AppData\Local\Temp\pip-install-1qm70fwh\PyOpenGL-accelerate 
"-Ic:\program files (x86)\python37-32\include" 
"-Ic:\program files (x86)\python37-32\include" 
"-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" 
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" 
/Tcsrc\wrapper.c 
/Fobuild\temp.win32-3.7\Release\src\wrapper.obj

'Programming > python(파이썬)' 카테고리의 다른 글

python wxpython  (0) 2019.05.08
PyOpenGL + ubuntu 18.04  (0) 2019.05.02
python + openGL  (0) 2019.04.30
python + openCV 공부 시작  (0) 2019.04.30
pypy  (0) 2018.04.04
Posted by 구차니

해보려는데 영 안되네.. 설치 안한게 있어서 그런가?

 

C:\Users>pip install pyopengl numpy glfw
Collecting pyopengl
  Downloading https://files.pythonhosted.org/packages/9c/1d/4544708aaa89f26c97cc09450bb333a23724a320923e74d73e028b3560f9/PyOpenGL-3.1.0.tar.gz (1.2MB)
     |████████████████████████████████| 1.2MB 731kB/s
Requirement already satisfied: numpy in c:\users\shin\appdata\local\programs\python\python37-32\lib\site-packages (1.16.3)
Collecting glfw
  Downloading https://files.pythonhosted.org/packages/af/3b/2f8c60fcb0a486eae4dd18c29de22ed667aed5e81f16874102f8580b5900/glfw-1.7.1-py2.py3-none-win32.whl (55kB)
     |████████████████████████████████| 61kB 27kB/s
Installing collected packages: pyopengl, glfw
  Running setup.py install for pyopengl ... done
Successfully installed glfw-1.7.1 pyopengl-3.1.0

 

C:\study\python>python gl.py
Traceback (most recent call last):
  File "gl.py", line 92, in 
    main()
  File "gl.py", line 13, in main
    window = glfw.create_window(800, 600, "My OpenGL window", None, None)
  File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 893, in create_window
    monitor, share)
  File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 516, in errcheck
    _reraise(exc[1], exc[2])
  File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 45, in _reraise
    raise exception.with_traceback(traceback)
  File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 495, in callback_wrapper
    return func(*args, **kwargs)
  File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 669, in _raise_glfw_errors_as_exceptions
    raise GLFWError(message)
glfw.GLFWError: (65542) b'WGL: The driver does not appear to support OpenGL'

[링크 : https://webnautes.tistory.com/1271]

[링크 : https://answers.microsoft.com/.../no-opengl-acceleration-with-hd-3000-on-windows-10/...]

[링크 : https://www.intel.com/content/www/us/en/support/articles/000005526/graphics-drivers.html?language=en_US]

 

+

2019.05.01

 

홈페이지 가보니 PyOpenGL_accelerate 패키지를 안깔아서 그런가?

Downloading and Installation
The easiest way to install PyOpenGL is using pip

$ pip install PyOpenGL PyOpenGL_accelerate

[링크 : http://pyopengl.sourceforge.net/]

'Programming > python(파이썬)' 카테고리의 다른 글

PyOpenGL + ubuntu 18.04  (0) 2019.05.02
python 3.7 + MS build tool 2015 + pyGL 또 실패 ㅠㅠ  (0) 2019.05.01
python + openCV 공부 시작  (0) 2019.04.30
pypy  (0) 2018.04.04
파이썬 print가 희한하네..  (0) 2017.04.02
Posted by 구차니

지하철에서 잉여하지 말고 이거나 해야지

노트북에 웹캠도 있으니 딱이네

 

[링크 : https://diy-project.tistory.com/78]

[링크 : https://pypi.org/project/opencv-contrib-python/]

 

vscode와 연동하기

[링크 : https://realpython.com/python-development-visual-studio-code/]

 

+

C:\Users>pip install OpenCV-Python
Collecting OpenCV-Python
  Downloading https://files.pythonhosted.org/packages/99/ad/864b2f284517249a96190fdf6b21a291d9716115d6886938ccd86afaf821/opencv_python-4.1.0.25-cp37-cp37m-win32.whl (25.7MB)
    100% |████████████████████████████████| 25.7MB 439kB/s
Collecting numpy>=1.14.5 (from OpenCV-Python)
  Downloading https://files.pythonhosted.org/packages/ab/75/9ac63977cbca68e17406a53a8c573a925a16771800be47a73f18c838f3fb/numpy-1.16.3-cp37-cp37m-win32.whl (10.0MB)
    100% |████████████████████████████████| 10.0MB 371kB/s
Installing collected packages: numpy, OpenCV-Python
Successfully installed OpenCV-Python-4.1.0.25 numpy-1.16.3
You are using pip version 19.0.3, however version 19.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

'Programming > python(파이썬)' 카테고리의 다른 글

python 3.7 + MS build tool 2015 + pyGL 또 실패 ㅠㅠ  (0) 2019.05.01
python + openGL  (0) 2019.04.30
pypy  (0) 2018.04.04
파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
Posted by 구차니

예전에 적은게 있나 모르겠다만

그냥 생각나서 라즈베리에서 쳐보니까

기본으로 패키지 통합된 듯


pi@raspberrypi:~ $ python

Python 2.7.9 (default, Sep 17 2016, 20:26:04)

[GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> exit() 


pi@raspberrypi:~ $ pypy

Python 2.7.10 (4.0.1+dfsg-1+rpi1, Mar 07 2016, 10:36:18)

[PyPy 4.0.1 with GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>> exit() 


pi@raspberrypi:~ $ which python

/usr/bin/python

pi@raspberrypi:~ $ which pypy

/usr/bin/pypy

pi@raspberrypi:~ $ ll /usr/bin/pypy

lrwxrwxrwx 1 root root 22 Mar  8  2016 /usr/bin/pypy -> ../lib/pypy/bin/pypy-c

pi@raspberrypi:~ $ ll /usr/lib/pypy/bin

total 32604

drwxr-xr-x 2 root root     4096 Nov 26  2016 .

drwxr-xr-x 8 root root     4096 Nov 26  2016 ..

-rwxr-xr-x 1 root root 33374512 Mar  8  2016 pypy-c


'Programming > python(파이썬)' 카테고리의 다른 글

python + openGL  (0) 2019.04.30
python + openCV 공부 시작  (0) 2019.04.30
파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
Posted by 구차니

망할(!) 유니코드 ㅠㅠ

sqlite의 내용이 utf-8일텐데 아무튼.. 이걸 받아서 print 하니

죄다 u'\u' 이런식으로 유니코드 문자열을 알려주는 접두와 16진수로만 출력이 된다

그래서 이걸 정상적으로 출력하는걸 찾아보는데

간편하게 출력하는건 없고.. 파이썬 print 함수의 특징으로 봐야 하려나?


튜플,리스트 단위로 출력하면 escape 된 채로

항목 하나만 출력하면 정상적으로 한글로 나온다.

도대체 머야?!


아무튼 아래와 같이 하면 정상출력되긴 한다.( u' ' 접두는 붙는다.)

print repr(a).decode("unicode-escape") 

[링크 : http://stackoverflow.com/.../python-print-unicode-strings-in-arrays-as-characters-not-code-points]

'Programming > python(파이썬)' 카테고리의 다른 글

python + openCV 공부 시작  (0) 2019.04.30
pypy  (0) 2018.04.04
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
Posted by 구차니

튜플은 (1,2,3) 식으로 출력되고

리스트는 [1,2,3] 식으로 출력된다.


다만 내용적으로는 리스트는 순서가 변할수 있으며(순서가 의미가 없다)

튜플은 순서를 바꿀수 없다(즉, 순서에 의미가 있다)


4.6.5. Tuples

Tuples are immutable sequences, typically used to store collections of heterogeneous data (such as the 2-tuples produced by the enumerate() built-in). Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a set or dict instance). 

[링크 : https://docs.python.org/3/library/stdtypes.html#tuples]


4.6.4. Lists

Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application). 

[링크 : https://docs.python.org/3/library/stdtypes.html#lists]

'Programming > python(파이썬)' 카테고리의 다른 글

pypy  (0) 2018.04.04
파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
python smtplib의 신비..?  (0) 2016.12.30
Posted by 구차니


type(변수명) 


참 쉽네...

[링크 : http://chouingchou.tistory.com/53]

'Programming > python(파이썬)' 카테고리의 다른 글

파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
python smtplib의 신비..?  (0) 2016.12.30
python이 인기라는데..  (0) 2014.03.19
Posted by 구차니

python에서 sqlite 파일을 접속해서 조작하는 방법


$ sudo apt-get install python-sqlite

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

  libsqlite0

Suggested packages:

  python-sqlite-dbg

The following NEW packages will be installed:

  libsqlite0 python-sqlite

0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded.

Need to get 141 kB of archives.

After this operation, 519 kB of additional disk space will be used.

Do you want to continue? [Y/n]

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsqlite0 armhf 2.8.17-12 [119 kB]

Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-sqlite armhf 1.0.1-11 [21.3 kB]

Fetched 141 kB in 1s (95.8 kB/s)

Selecting previously unselected package libsqlite0.

(Reading database ... 137326 files and directories currently installed.)

Preparing to unpack .../libsqlite0_2.8.17-12_armhf.deb ...

Unpacking libsqlite0 (2.8.17-12) ...

Selecting previously unselected package python-sqlite.

Preparing to unpack .../python-sqlite_1.0.1-11_armhf.deb ...

Unpacking python-sqlite (1.0.1-11) ...

Setting up libsqlite0 (2.8.17-12) ...

Setting up python-sqlite (1.0.1-11) ...

Processing triggers for libc-bin (2.19-18+deb8u7) ...


pi@raspberrypi:~ $ cd src

pi@raspberrypi:~/src $ ll

total 2060

drwxr-xr-x  2 pi pi    4096 Mar 30 14:40 .

drwxr-xr-x 30 pi pi    4096 Mar 30 14:34 ..

-rw-r--r--  1 pi pi 2099200 Mar 29 12:29 sqlite.udb


pi@raspberrypi:~/src $ python

Python 2.7.9 (default, Sep 17 2016, 20:26:04)

[GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import sqlite3

>>> conn = sqlite3.connect('sqlite.udb')

>>> c = conn.cursor()

>>> c.execute("select * from tbl_recv")

<sqlite3.Cursor object at 0x769eaa20> 


데이터가 유니코드로 나오나..

# we can also implement a custom text_factory ...

# here we implement one that will ignore Unicode characters that cannot be

# decoded from UTF-8

con.text_factory = lambda x: unicode(x, "utf-8", "ignore") 


[링크 : https://docs.python.org/2/library/sqlite3.html]

'Programming > python(파이썬)' 카테고리의 다른 글

파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
python smtplib의 신비..?  (0) 2016.12.30
python이 인기라는데..  (0) 2014.03.19
python2 vs python3  (0) 2013.01.02
Posted by 구차니

어라?

파이썬으로 메일보내는데

새가

ㅅㅐ 로 보내지네.. 머지?


[링크 : http://unicode.scarfboy.com/?s=U%2BC0C8]

[링크 : http://unicode.scarfboy.com/?s=U%2b1109]

[링크 : http://unicode.scarfboy.com/?s=U%2b1162]



+

설정해도 안되고..

일단 ssh에서 직접 스크립트를 실행하면 한글이 안깨지고 가는데..

svn 통해서 hook 실행되면 깨진다.

[링크 : https://mikewest.org/2006/06/subversion-post-commit-hooks-101]

[링크 : http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks]

'Programming > python(파이썬)' 카테고리의 다른 글

파이썬 type 확인하기  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
python이 인기라는데..  (0) 2014.03.19
python2 vs python3  (0) 2013.01.02
PyOpenGL  (0) 2011.10.04
Posted by 구차니
한동안 죽어있다가 이제야 조금 살아나는 기미가 보이긴 한데
학원이나 아는 사람들에게 이야기를 들으면
요즘 각광받는 언어라고 해서 참으로 의아한..

python2 2.7.x 에서 한동안 3.x 대로의 이전이 쉽지 않았는지 거의 3년 가량을 죽어 있다가
2014년 3월 16일 3.4.0이 릴리즈 된 걸 봐서는 이제 이 언어도 살아 날지도 모르겠다.

[링크 : https://www.python.org/download/releases/]

'Programming > python(파이썬)' 카테고리의 다른 글

python sqlite3  (0) 2017.03.30
python smtplib의 신비..?  (0) 2016.12.30
python2 vs python3  (0) 2013.01.02
PyOpenGL  (0) 2011.10.04
python 3.2.2 64bit 버전 설치  (4) 2011.09.13
Posted by 구차니