2023년 5월 25일 목요일

[JetBrains] Intellij, WebStorm IDEA가 특정 project만 열지 못할 때

Intellij, WebStorm IDEA가 특정 project만 열지 못할 때


순서

  • Local history file위치로 이동
  • Windows 기준: %LOCALAPPDATA%\JetBrains\<product><version>으로 이동
  • 문제가 되는 부분의 임시 정보 file 삭제


1
2
3
4
C:\Users\***>cd "%LOCALAPPDATA%\JetBrains\<product><version>\workspace"
 
C:\Users\***\AppData\Local\JetBrains\IntelliJIdea2023.1\workspace>del [열리지 않는 프로젝트].xml
 
cs


2023년 5월 24일 수요일

[python] Windows에서 Python/ Pip 설치

Python을 Windows에서 설치해보자

설치

방법 #1: chocolate를 이용하면, 조금 더 편하게 설치할 수 있다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
C:\Users\***>choco install python
Chocolatey v1.4.0
Installing the following packages:
python
By installing, you accept licenses for the packages.
Progress: Downloading python3 3.11.3... 100%
Progress: Downloading python311 3.11.3... 100%
Progress: Downloading vcredist2015 14.0.24215.20170201... 100%
Progress: Downloading vcredist140 14.36.32532... 100%
Progress: Downloading chocolatey-core.extension 1.4.0... 100%
Progress: Downloading chocolatey-compatibility.extension 1.0.0... 100%
Progress: Downloading KB3033929 1.0.5... 100%
Progress: Downloading chocolatey-windowsupdate.extension 1.0.5... 100%
Progress: Downloading KB3035131 1.0.3... 100%
Progress: Downloading KB2919355 1.0.20160915... 100%
Progress: Downloading KB2919442 1.0.20160915... 100%
Progress: Downloading KB2999226 1.0.20181019... 100%
Progress: Downloading python 3.11.3... 100%
 
chocolatey-compatibility.extension v1.0.0 [Approved]
chocolatey-compatibility.extension package files install completed. Performing other installation steps.
 Installed/updated chocolatey-compatibility extensions.
 The install of chocolatey-compatibility.extension was successful.
  Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-compatibility'
 
chocolatey-core.extension v1.4.0 [Approved]
chocolatey-core.extension package files install completed. Performing other installation steps.
 Installed/updated chocolatey-core extensions.
 The install of chocolatey-core.extension was successful.
  Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core'
 
chocolatey-windowsupdate.extension v1.0.5 [Approved]
chocolatey-windowsupdate.extension package files install completed. Performing other installation steps.
 Installed/updated chocolatey-windowsupdate extensions.
 The install of chocolatey-windowsupdate.extension was successful.
  Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-windowsupdate'
 
KB3035131 v1.0.3 [Approved]
kb3035131 package files install completed. Performing other installation steps.
The package KB3035131 wants to run 'ChocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): A
Skipping installation because update KB3035131 does not apply to this operating system (Microsoft Windows 10 Pro).
 The install of kb3035131 was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.
KB3033929 v1.0.5 [Approved]
kb3033929 package files install completed. Performing other installation steps.
Skipping installation because update KB3033929 does not apply to this operating system (Microsoft Windows 10 Pro).
 The install of kb3033929 was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.
KB2919442 v1.0.20160915 [Approved]
kb2919442 package files install completed. Performing other installation steps.
Skipping installation because this hotfix only applies to Windows 8.1 and Windows Server 2012 R2.
 The install of kb2919442 was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.
KB2919355 v1.0.20160915 [Approved]
kb2919355 package files install completed. Performing other installation steps.
Skipping installation because this hotfix only applies to Windows 8.1 and Windows Server 2012 R2.
 The install of kb2919355 was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.
KB2999226 v1.0.20181019 [Approved] - Possibly broken
kb2999226 package files install completed. Performing other installation steps.
Skipping installation because update KB2999226 does not apply to this operating system (Microsoft Windows 10 Pro).
 The install of kb2999226 was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.
vcredist140 v14.36.32532 [Approved]
vcredist140 package files install completed. Performing other installation steps.
Downloading vcredist140-x86
  from 'https://download.visualstudio.microsoft.com/download/pr/eaab1f82-787d-4fd7-8c73-f782341a0c63/5365A927487945ECB040E143EA770ADBB296074ECE4021B1D14213BDE538C490/VC_redist.x86.exe'
Progress: 100% - Completed download of C:\Users\***\AppData\Local\Temp\chocolatey\vcredist140\14.36.32532\VC_redist.x86.exe (13.2 MB).
Download of VC_redist.x86.exe (13.2 MB) completed.
Hashes match.
Installing vcredist140-x86...
vcredist140-x86 has been installed.
Downloading vcredist140-x64 64 bit
  from 'https://download.visualstudio.microsoft.com/download/pr/eaab1f82-787d-4fd7-8c73-f782341a0c63/917C37D816488545B70AFFD77D6E486E4DD27E2ECE63F6BBAAF486B178B2B888/VC_redist.x64.exe'
Progress: 100% - Completed download of C:\Users\***\AppData\Local\Temp\chocolatey\vcredist140\14.36.32532\VC_redist.x64.exe (24.18 MB).
Download of VC_redist.x64.exe (24.18 MB) completed.
Hashes match.
Installing vcredist140-x64...
vcredist140-x64 has been installed.
  vcredist140 may be able to be automatically uninstalled.
 The install of vcredist140 was successful.
  Software installed as 'exe', install location is likely default.
vcredist2015 v14.0.24215.20170201 [Approved]
vcredist2015 package files install completed. Performing other installation steps.
 The install of vcredist2015 was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\vcredist2015'
python311 v3.11.3 [Approved]
python311 package files install completed. Performing other installation steps.
Installing 64-bit python311...
python311 has been installed.
Added C:\ProgramData\chocolatey\bin\python3.11.exe shim pointed to 'c:\python311\python.exe'.
Python installed to: 'C:\Python311'
Restricting write permissions to Administrators
  python311 can be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of python311 was successful.
  Software installed as 'exe', install location is likely default.
python3 v3.11.3 [Approved]
python3 package files install completed. Performing other installation steps.
 The install of python3 was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\python3'
python v3.11.3 [Approved]
python package files install completed. Performing other installation steps.
 The install of python was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\python'
Chocolatey installed 13/13 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Installed:
 - kb2919355 v1.0.20160915
 - python v3.11.3
 - kb3033929 v1.0.5
 - chocolatey-core.extension v1.4.0
 - kb2999226 v1.0.20181019
 - python3 v3.11.3
 - vcredist2015 v14.0.24215.20170201
 - kb2919442 v1.0.20160915
 - python311 v3.11.3
 - vcredist140 v14.36.32532
 - chocolatey-compatibility.extension v1.0.0
 - kb3035131 v1.0.3
 - chocolatey-windowsupdate.extension v1.0.5
cs

방법 #2: Windows 10/11은 Windows Terminal 혹은 Command Line(cmd.exe)에서, python을 실행하면, Microsoft Store가 자동으로 실행된다.


편한 방법을 선택하자. #2번을 추천한다.

패키지 설치 (package installation)

pip로 OpenAI 설치하는 경우,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
C:\Users\***>pip install openai
Collecting openai
  Downloading openai-0.27.7-py3-none-any.whl (71 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.0/72.0 kB 3.9 MB/s eta 0:00:00
Collecting requests>=2.20
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB ? eta 0:00:00
Collecting tqdm
  Downloading tqdm-4.65.0-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB ? eta 0:00:00
Collecting aiohttp
  Downloading aiohttp-3.8.4-cp311-cp311-win_amd64.whl (317 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 317.2/317.2 kB ? eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.7/96.7 kB ? eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB ? eta 0:00:00
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.0.2-py3-none-any.whl (123 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.2/123.2 kB ? eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 157.0/157.0 kB ? eta 0:00:00
Collecting attrs>=17.3.0
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB ? eta 0:00:00
Collecting multidict<7.0,>=4.5
  Downloading multidict-6.0.4-cp311-cp311-win_amd64.whl (28 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
  Downloading yarl-1.9.2-cp311-cp311-win_amd64.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.2/60.2 kB ? eta 0:00:00
Collecting frozenlist>=1.1.1
  Downloading frozenlist-1.3.3-cp311-cp311-win_amd64.whl (32 kB)
Collecting aiosignal>=1.1.2
  Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting colorama
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Installing collected packages: urllib3, multidict, idna, frozenlist, colorama, charset-normalizer, certifi, attrs, async-timeout, yarl, tqdm, requests, aiosignal, aiohttp, openai
  WARNING: The script normalizer.exe is installed in 'C:\Users\***\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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.
  WARNING: The script tqdm.exe is installed in 'C:\Users\***\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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.
  WARNING: The script openai.exe is installed in 'C:\Users\***\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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 aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 attrs-23.1.0 certifi-2023.5.7 charset-normalizer-3.1.0 colorama-0.4.6 frozenlist-1.3.3 idna-3.4 multidict-6.0.4 openai-0.27.7 requests-2.31.0 tqdm-4.65.0 urllib3-2.0.2 yarl-1.9.2
 
[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: C:\Users\***\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip
cs

업그래이드 (갱신)

위 OpenAI 설치하는 예에서, 맨 아래줄을 보면, update하라고 나온다.
"[notice] To update, run: ..."
명령을 그대로 복사해서, 실행하면, 아래와 같이 된다.
1
2
3
4
5
6
7
8
9
C:\Users\***>python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\lib\site-packages (22.3.1)
Collecting pip
  Downloading pip-23.1.2-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 21.9 MB/s eta 0:00:00
Installing collected packages: pip
  WARNING: The scripts pip.exe, pip3.11.exe and pip3.exe are installed in 'C:\Users\***\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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-23.1.2
cs


[Windows] Chocolatey upgrade

Chochlatey upgrade 

절차는 아주 간단하다.

Windows Terminal (혹은 Command LIne)에서, 아래와 같이 싫행하면 된다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
C:\Users\***>choco upgrade chocolatey -y4
Chocolatey v1.2.1
Upgrading the following packages:
chocolatey
By upgrading, you accept licenses for the packages.
 
You have chocolatey v1.2.1 installed. Version 1.4.0 is available based on your source(s).
Progress: Downloading chocolatey 1.4.0... 100%
 
chocolatey v1.4.0
chocolatey package files upgrade completed. Performing other installation steps.
Creating ChocolateyInstall as an environment variable (targeting 'Machine')
  Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
WARNING: It's very likely you will need to close and reopen your shell
  before you can use choco.
Restricting write permissions to Administrators
We are setting up the Chocolatey package repository.
The packages themselves go to 'C:\ProgramData\chocolatey\lib'
  (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
  and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
Creating Chocolatey folders if they do not already exist.
WARNING: You can safely ignore errors related to missing log files when
  upgrading from a version of Chocolatey less than 0.9.9.
  'Batch file could not be found' is also safe to ignore.
  'The system cannot find the file specified' - also safe.
WARNING: Not setting tab completion: Profile file does not exist at 'C:\Users\***\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
Chocolatey (choco.exe) is now ready.
You can call choco from anywhere, command line or powershell by typing choco.
Run choco /? for a list of functions.
You may need to shut down and restart powershell and/or consoles
 first prior to using choco.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The upgrade of chocolatey was successful.
  Software install location not explicitly set, it could be in package or
  default install location of installer.
Chocolatey upgraded 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
cs

주의! 간혹, 관리자 권한을 요구하는데, 그때는 Windows Terminal 혹은 Command Line(cmd.exe)를 관리자 권한으로 실행하고 다시 수행하면 된다.
또한, 드물께, choco.exe.old를 생성하는 문제가 있는데, 이때는, choco가 설치된 곳(보통 "C:\ProgramData\chocolatey") 에서 *.old, "bin"이하의 *.old 파일을 모두 제거해주면 된다.

2023년 5월 16일 화요일

[flutter] Android - Package간 sdk version 등이 맞지 않아 오류가 발생하는 경우

[flutter] Android - Package간 sdk version 등이 맞지 않아 오류가 발생하는 경우

에러 문구:

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
...\android\app\src\debug\AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:some_package] ...\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 21, or use tools:overrideLibrary="com.
some_package" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:some_package] ...\build\awesome_notifications\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
  	Suggestion: use a compatible library with a minSdk of at most 16,
  		or increase this project's minSdk version to at least 21,
  		or use tools:overrideLibrary="com.some_package" to force usage (may lead to runtime failures)
* Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 12s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐ │ The plugin awesome_notifications requires a higher Android SDK version. │ │ Fix this issue by adding the following to the file │ │ ...\android\app\build.gradle: │ │ android { │ │ defaultConfig { │ │ minSdkVersion 21 │ │ } │ │ } │ │ │ │ Following this change, your app will not be available to users running Android SDKs below 21. │ │ Consider searching for a version of this plugin that supports these lower versions of the │ │ Android SDK instead. │ │ For more information, see: │ │ https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration │ └───────────────────────────────────────────────────────────────────────────────────────────────┘ Exception: Gradle task assembleDebug failed with exit code 1

해결방법:

"android/local. Properties"

flutter.compileSdkVersion=31
flutter.minSdkVersion=21
flutter.targetSdkVersion=31

"android/app/build.gradle"

...
def flutterMinSdkVersion = localProperties.getProperty('flutter.minSdkVersion')
if (flutterMinSdkVersion == null) {
flutterMinSdkVersion = '21'
}

def flutterTargetSdkVersion = localProperties.getProperty('flutter.targetSdkVersion')
if (flutterTargetSdkVersion == null) {
flutterTargetSdkVersion = '30'
}
...

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.yagapp.apps.workout_timer"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
// minSdkVersion flutter.minSdkVersion (x)
// targetSdkVersion flutter.targetSdkVersion (x)
minSdkVersion flutterMinSdkVersion.toInteger() (o)
targetSdkVersion flutterTargetSdkVersion.toInteger() (o)
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}


[JetBrains] Intellij, WebStorm IDEA가 특정 project만 열지 못할 때

Intellij, WebStorm IDEA가 특정 project만 열지 못할 때 순서 Local history file위치 로 이동 Windows 기준: %LOCALAPPDATA%\JetBrains\<product><version>...