반응형

pip 설치 UnicodeDecodeError: 'utf-8' 오류


파이썬의 pip를 사용해서 패키지(package)를 설치하던 중 다음과 같은 오류가 발생했다.

Exception:
Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 48: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Python36\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Python36\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Python36\lib\site-packages\pip\req\req_install.py", line 878, in install
    spinner=spinner,
  File "C:\Python36\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "C:\Python36\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 48: invalid start byte
728x90

관련 자료를 찾아보니 python36-32\lib\site-packages\pip\compat\__init__.py 파일을 수정하면 된다고 했지만, 이 방법으로는 해결되지 않았다.

 

해결 방법


필자의 경우 pip 패키지를 최신 버전으로 업그레이드하여 해결할 수 있었다.

기존에 설치된 pip 버전은 9.0.1로, 현재 포스팅 작성 시점의 최신 버전21.0.1로 업그레이드했다.

pip 업그레이드 명령어

인터넷에 연결된 PC에서 다음 명령어를 입력하면 pip가 업그레이드된다.

python -m pip install --upgrade pip

 

pip 업그레이드 명령어 (오프라인)

인터넷이 안 되는 PC에서는 아래 사이트에서 최신 pip를 다운로드 하고, 다음 명령어를 실행한다.

python -m pip install .\pip-21.0.1-py3-none-any.whl --no-index
반응형
반응형

사용자 계정 컨트롤


윈도우 운영체제에서는 실행하려는 프로그램이 시스템 설정이나 구성을 변경할 수도 있는 높은 권한요구될 때, 사용자 계정 컨트롤(User Account Control, UAC)을 이용해서 PC 사용자에게 알린다.

 

사용자 계정 컨트롤은 특정 프로그램이 사용자 동의 없이 침입해 시스템악의적으로 조작하거나 사용자 정보탈취해가는 것을 막기 위한 장치로, Windows Vista(비스타) 운영체제에서 처음 도입되었으며 현재의 Windows 10에서 까지 유지되어왔다.

 

일반적으로는 방패모양 아이콘이 붙은 실행파일(exe)을 클릭하거나, 프로그램 아이콘에서 마우스 오른쪽 버튼을 클릭하여 '관리자 권한으로 실행'을 선택하면 아래와 같은 사용자 계정 컨트롤 팝업이 발생한다.

사용자 계정 컨트롤(UAC) 팝업

이 앱이 디바이스를 변경할 수 있도록 허용하시겠어요?
728x90

사용자가 위의 팝업에서 '예'를 선택하면, 해당 실행 파일은 관리자와 동등한 권한으로 동작하는 것을 허용하는 것이 된다.

반면 '아니요'를 선택하면 해당 실행 파일은 실행되지 못한다.

 

관리자 권한으로 실행되는 프로그램이 또 다른 실행 파일을 실행할 경우 해당 프로그램 또한 권한을 상속받아 관리자 권한으로 동작하게 된다.

 

당연히 보안을 위해서는 사용자 계정 컨트롤을 켜 두는 것이 좋다.

하지만 충분히 신뢰할 수 있는 실행 파일을 반복적으로 실행해야 하거나, 특정 프로그램 실행에 문제가 있을 때 해킹에 대한 리스크가 낮은 편이라면 일시적으로 UAC를 꺼둠으로써 불필요한 팝업이 뜨는 것을 방지할 수 있다.

 

그럼 사용자 계정 컨트롤을 끄는 방법에 대해서 알아보자.

 

사용자 계정 컨트롤 설정 방법


사용자 계정 컨트롤 끄는 방법

1. 시작 메뉴에서 '사용자 계정 컨트롤'검색하여 설정 변경을 실행한다.

시작 메뉴에서 '사용자 계정 컨트롤' 검색

또는 제어판에서 [사용자 계정] - [사용자 계정 컨트롤 설정 변경]으로 진입할 수 있다.

 

2. [컴퓨터 변경 내용에 대한 알림 조건 선택]에서 가장 낮은 단계로 설정한다.

컴퓨터 변경 내용에 대한 알림 조건 선택

알림의 조건은 항상 알림부터 알리지 않음까지 4단계로 선택할 수 있으며,

위에서 2번째 단계인 '앱에서 사용자 모르게 컴퓨터를 변경하려는 경우에만 알림'이 기본값이다.

사용자 계정 컨트롤을 끄려는 경우 가장 낮은 단계인 '다음의 경우 항상 알리지 않음(사용자 계정 컨트롤 끄기)'선택하면 된다.

 

각 단계의 설명은 다음과 같다.

  • 다음의 경우 항상 알림
    • 앱에서 사용자 모르게 소프트웨어를 설치하거나 컴퓨터를 변경하려는 경우
    • 사용자가 직접 Windows 설정을 변경하려는 경우
    • (새로운 소프트웨어를 자주 설치하거나 친숙하지 않은 웹 사이트를 자주 방문하는 경우 권장합니다.)
  • 앱에서 사용자 모르게 컴퓨터를 변경하려는 경우에만 알림 (기본값)
    • 사용자가 직접 Windows 설정을 변경하려는 경우 알리지 않음
    • (익숙한 앱을 사용하거나 친숙한 웹 사이트를 방문하는 경우 권장합니다.)
  • 앱에서 사용자 모르게 컴퓨터를 변경하려는 경우에만 알림 (바탕 화면을 흐리게 표시하지 않음)
    • 사용자가 직접 Windows 설정을 변경하려는 경우 알리지 않음.
    • (권장하지 않습니다. 컴퓨터의 바탕 화면을 흐리게 표시하는 데 시간이 오래 걸리는 경우에만 이 옵션을 선택하십시오.)
  • 다음의 경우 항상 알리지 않음(사용자 계정 컨트롤 끄기)
    • 앱에서 사용자 모르게 소프트웨어를 설치하거나 컴퓨터를 변경하려는 경우
    • 사용자가 직접 Windows 설정을 변경하는 경우
    • (권장하지 않습니다.)

 

사용자 계정 컨트롤 켜는 방법

작업이 모두 끝나고 설정을 원래대로 되돌릴 때 다음과 같이 설정하면 된다.

1. [컴퓨터 변경 내용에 대한 알림 조건 선택]에서 위에서 2번째 단계로 설정한다.

가장 위의 1단계를 선택하면 이전보다 더 번거로워지게 되므로, 원래의 기본값2단계를 선택하는 것을 권장한다.

 


사용자 계정 컨트롤을 끄고, 다시 켜는 방법에 대해 살펴보았다.

 

해당 기능을 끄게되면 앞서 언급했던 보안 위험을 감수할 수밖에 없으므로, 가능하면 끄지 않고 사용하는 것을 권장한다.

 

만약 기능 자체를 끄는게 목적이 아니라 팝업이 발생할 때 PC 성능으로 인해 느려짐이 발생하는 경우라면, 3단계를 선택하여 바탕 화면을 흐리게 표시하지 않도록 설정하면 보안을 유지하면서 성능 문제를 조금이나마 해소될 수 있을 것이다.

반응형
반응형

원인


Visual Studio 2015 프로젝트 Git 관련 작업 중에 아래와 같이 VC.opendb를 액세스 할 수 없다는 오류가 발생했다.

 

Could not open 'C:/Solution1/Solution1.VC.VC.opendb': 다른 프로세스가 파일을 사용 중이기 때문에 프로세스가 액세스 할 수 없습니다.

VC.opendb는 Visual Studio 2015 부터 도입된 파일인데, Visual C++ IntelliSense의 데이터베이스이다.

기존의 .sdf 파일(SQL Server Compact Edition Database File)을 대체하는 역할을 담당한다.

 

VC.opendb 파일은 솔루션 및 프로젝트가 사용 중일 때만 생성되고 솔루션을 닫으면 자동 삭제된다.

 

그럼 솔루션을 오픈할 때 생성되는 VC.opendb를 왜 오픈하지 못하는 것일까?

 

728x90

 

해결


먼저 프로세스 모니터(Procmon)를 통해 해당 파일에 대한 핸들을 잡고 있는 프로세스를 살펴봤는데, Visual Studio의 devenv.exe 밖에 확인되지 않았다.

 

분명 Git 작업과 연관이 있을 것이라 생각하여 확인해봤는데, 솔루션 디렉터리에 .gitignore 파일이 존재하지 않는다는 사실을 발견했다.

.gitignore 파일은 깃에서 revision 관리를 원치 않는 특정 파일이나 확장자 또는 디렉터리 관리 대상에서 제외할 때 사용하는 파일이다.

 

이번 경우에는 해당 파일이 없었기 때문에 VC.db 와 같은 파일들이 버전 관리에 포함되어 git 프로세스와 충돌이 발생한 것이었다.

 

해결 방법은 간단하다.

.gitignore 파일을 솔루션의 루트 디렉터리에 생성하면 되는 것이다.

 

아래는 Visual Studio 2015의 기본 .gitignore 파일이다.

해당 내용을 복사해서 .gitignore 파일로 생성해도 되고, 아래에 첨부한 파일을 다운로드하여도 되겠다.

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml

# TODO: Un-comment the next line if you do not want to checkin 
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config

# Windows Store app package directory
AppPackages/
BundleArtifacts/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml

# Paket dependency manager
.paket/paket.exe

# FAKE - F# Make
.fake/

.gitignore
0.00MB

반응형

+ Recent posts