Suddenly throw ModuleNotFoundError: No module named 'importlib.util' - python-3.7

I was trying to install some python packages. Before I was not having this issue. it suddenly started giving me ModuleNotFoundError: No module named 'importlib.util' error.
Full log is below
#8 53.71 Collecting packaging
#8 53.74 Downloading packaging-20.9-py2.py3-none-any.whl (40 kB)
#8 53.84 Collecting importlib<2.0.0,>=1.0.4
#8 53.87 Downloading importlib-1.0.4.zip (7.1 kB)
#8 53.91 ERROR: Command errored out with exit status 1:
#8 53.91 command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0ljeewgl/importlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0ljeewgl/importlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-nx4pttf0
#8 53.91 cwd: /tmp/pip-install-0ljeewgl/importlib/
#8 53.91 Complete output (11 lines):
#8 53.91 Traceback (most recent call last):
#8 53.91 File "<string>", line 1, in <module>
#8 53.91 File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 10, in <module>
#8 53.91 import distutils.core
#8 53.91 File "/usr/lib/python3.7/distutils/core.py", line 16, in <module>
#8 53.91 from distutils.dist import Distribution
#8 53.91 File "/usr/lib/python3.7/distutils/dist.py", line 19, in <module>
#8 53.91 from distutils.util import check_environ, strtobool, rfc822_escape
#8 53.91 File "/usr/lib/python3.7/distutils/util.py", line 9, in <module>
#8 53.91 import importlib.util
#8 53.91 ModuleNotFoundError: No module named 'importlib.util'
#8 53.91 ----------------------------------------
#8 53.91 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
------

Related

Mac Flutter Install: can't access the lockfile

I've been able to use flutter to create apps on my mac using my "work user account".
I now want to be able to login as myself and create apps so I've created a new user. I've made the workaccount path to flutter rw for "staff" and using my personalaccount I can access all the files. ls -l confirms I have rw access to the lockfile. I tried deleting the lockfile but that didn't help.
I've updated $PATH and my workaccount flutter is there when I echo.
I've tried killall -9 dart on my workaccount .
When I run flutter doctor -v I still get this:
Flutter failed to open a file at "/Users/workaccount/Development/flutter/bin/cache/lockfile". > The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _throwFileSystemException (package:flutter_tools/src/base/error_handling_io.dart:778:3)
#2 _handlePosixException (package:flutter_tools/src/base/error_handling_io.dart:726:3)
#3 _runSync (package:flutter_tools/src/base/error_handling_io.dart:583:7)
#4 ErrorHandlingFile.openSync (package:flutter_tools/src/base/error_handling_io.dart:291:12)
#5 Cache.lock (package:flutter_tools/src/cache.dart:304:24)
#6 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:240:31)
#7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:236:13)
#8 AppContext.run. (package:flutter_tools/src/base/context.dart:150:29)
#9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:7)
#10 _rootRun (dart:async/zone.dart:1354:13)
#11 _CustomZone.run (dart:async/zone.dart:1258:19)
#12 _runZoned (dart:async/zone.dart:1789:10)
#13 runZoned (dart:async/zone.dart:1711:10)
#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
#15 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:19)
#16 run.. (package:flutter_tools/runner.dart:62:9)
#17 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#18 main (package:flutter_tools/executable.dart:91:3)
My mac skills aren't great, can anyone suggest something that might work?
you may run this command :
$ sudo chown -R <username> /Users/workaccount/Development/flutter/bin/cache/lockfile
more info :
Check permission for the mentioned directory via:
ls -l /home/raphael/flutter/
the flutter subfolder in there should have the same user id (or the group) as your current user, with whom you are trying to create the project.
If not, while being in the folder mentioned above, try to change permission on the folder via:
chown -R YOUR_USERNAME flutter
Run the first command again to verify that the apropriate user is now shown on the folder. Then try to create the project again.
Update
If you want to have permission on each account you can do it:
sudo chmod 777 /Users/workaccount/Development/flutter/bin/cache/lockfile
you go to documents and command+up+. and you can see .bashrc, you must add your path (export PATH="$PATH:/Users/ecemE/flutter/bin"
my path) after terminal off and open again, write flutter doctor and fix this problem :D

Missing argument for "base" encrypt 4.1.0 flutter

I am trying to use the package encrypt 4.1. for flutter and I am getting the following error in the terminal when I try to run this command
secure-random -b
the output is the following:
FormatException: Missing argument for "base".
#0 Parser.validate (package:args/src/parser.dart:290:21)
#1 Parser.readNextArgAsValue (package:args/src/parser.dart:114:5)
#2 Parser.parseSoloOption (package:args/src/parser.dart:145:7)
#3 Parser.parse (package:args/src/parser.dart:86:11)
#4 ArgParser.parse (package:args/src/arg_parser.dart:326:42)
#5 main (file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/encrypt-4.1.0/bin/secure-random.dart:18:29)
#6 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Unhandled exception:
FormatException: Missing argument for "base".
#0 Parser.validate (package:args/src/parser.dart:290:21)
#1 Parser.readNextArgAsValue (package:args/src/parser.dart:114:5)
#2 Parser.parseSoloOption (package:args/src/parser.dart:145:7)
#3 Parser.parse (package:args/src/parser.dart:86:11)
#4 ArgParser.parse (package:args/src/arg_parser.dart:326:42)
#5 main (file:///C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/encrypt-4.1.0/bin/secure-random.dart:18:29)
#6 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)```
I have dart-sdk/bin into the environment variables,does anyone know why and how to solve it?

Flutter Installation: OS Error: Access is denied, errno=5

I tried installing flutter by following the steps at https://flutter.dev/docs/get-started/install , but kept running into the following error when inputting flutter in to Command Prompt:
Unhandled exception: FileSystemException: Cannot open file, path =
'C:\Users\matt\AppData\Roaming.flutter_tool_state' (OS Error: Access
is denied. , errno = 5) #0 _File.throwIfError
(dart:io/file_impl.dart:645:7) #1 _File.openSync
(dart:io/file_impl.dart:489:5) #2 _File.writeAsBytesSync
(dart:io/file_impl.dart:614:31) #3 _File.writeAsStringSync
(dart:io/file_impl.dart:638:5) #4 ForwardingFile.writeAsStringSync
(package:file/src/forwarding/forwarding_file.dart:154:16) #5
ErrorHandlingFile.writeAsStringSync.
(package:flutter_tools/src/base/error_handling_file_system.dart:137:22)
#6 ErrorHandlingFile._runSync (package:flutter_tools/src/base/error_handling_file_system.dart:163:16)
#7 ErrorHandlingFile.writeAsStringSync (package:flutter_tools/src/base/error_handling_file_system.dart:136:5)
#8 Config._flushValues (package:flutter_tools/src/base/config.dart:86:11) #9 Config.setValue
(package:flutter_tools/src/base/config.dart:75:5) #10
_DefaultPersistentToolState.isRunningOnBot= (package:flutter_tools/src/persistent_tool_state.dart:120:45) #11
BotDetector.isRunningOnBot
(package:flutter_tools/src/base/bot_detector.dart:46:33) #12 isRunningOnBot
(package:flutter_tools/src/globals.dart:98:48) #13
runInContext.runnerWrapper
(package:flutter_tools/src/context_runner.dart:63:34) #14
AppContext.run.
(package:flutter_tools/src/base/context.dart:150:29) #15 _rootRun
(dart:async/zone.dart:1184:13) #16 _CustomZone.run
(dart:async/zone.dart:1077:19) #17 _runZoned
(dart:async/zone.dart:1619:10) #18 runZoned
(dart:async/zone.dart:1539:10) #19 AppContext.run
(package:flutter_tools/src/base/context.dart:149:18) #20 runInContext
(package:flutter_tools/src/context_runner.dart:67:24) #21 run
(package:flutter_tools/runner.dart:48:10) #22 main
(package:flutter_tools/executable.dart:69:9) #23 main
(file:///C:/b/s/w/ir/k/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#24 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32) #25
_RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Any help would be appreciated!
(OS Error: Access is denied. , errno = 5)
Error 5: Access denied is a known issue on Windows 10. This error prevents you from installing software on your computer and accessing or modifying certain files.
The reason for this issue is the non-availability of the permissions. Windows 10 will prevent you from installing if you don’t have the Administrator privileges or if your account is not the administrator account.
How to Fix Error 5 Access Denied?
It worked for me disabling the "Controlled folder access" option in Windows Defender

Troubleshooting Math::PARI crash inside mod_perl

I build (brewed) my own perl, then the mod_perl module, and then installed all required perl libraries.
The mod_perl environment works fine. One-liners with Math::PARI also work, for example:
perl -MMath::Pari -e "use Math::Pari ':float', 'type_name'; warn type_name 22222222222222222222222;"
t_INT at -e line 1.
However, when I start apache2/mod_perl and try to load Math::PARI I get the following crash:
root#paris:/usr/apps/test/config# gdb -q /usr/sbin/apache2
Reading symbols from /usr/sbin/apache2...(no debugging symbols found)...done.
(gdb) set args -f /usr/apps/test/config/httpd.conf -k start
(gdb) run
Starting program: /usr/sbin/apache2 -f /usr/apps/test/config/httpd.conf -k start
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff367bea7 in moveoffstack_newer_than () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux-thread-multi/auto/Math/Pari/Pari.so
(gdb) bt
#0 0x00007ffff367bea7 in moveoffstack_newer_than () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux-thread-multi/auto/Math/Pari/Pari.so
#1 0x00007ffff367c008 in XS_Math__Pari_DESTROY () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux-thread-multi/auto/Math/Pari/Pari.so
#2 0x00007ffff5bca17c in Perl_pp_entersub () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#3 0x00007ffff5b5c771 in Perl_call_sv () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#4 0x00007ffff5bd0629 in Perl_sv_clear () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#5 0x00007ffff5bd0ce2 in Perl_sv_free2 () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#6 0x00007ffff5bcb647 in S_visit () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#7 0x00007ffff5bd1456 in Perl_sv_clean_objs () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#8 0x00007ffff5b5e4a7 in perl_destruct () from /opt/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux-thread-multi/CORE/libperl.so
#9 0x00007ffff7f8d477 in modperl_perl_destruct () from /opt/perl5/perlbrew/perls/perl-5.14.2/usr/lib/apache2/modules/mod_perl.so
#10 0x00007ffff7f7d81e in modperl_interp_destroy () from /opt/perl5/perlbrew/perls/perl-5.14.2/usr/lib/apache2/modules/mod_perl.so
#11 0x00007ffff7f7e3c5 in modperl_tipool_destroy () from /opt/perl5/perlbrew/perls/perl-5.14.2/usr/lib/apache2/modules/mod_perl.so
#12 0x00007ffff7f7d882 in modperl_interp_pool_destroy () from /opt/perl5/perlbrew/perls/perl-5.14.2/usr/lib/apache2/modules/mod_perl.so
#13 0x00007ffff776499e in apr_pool_destroy () from /usr/lib/libapr-1.so.0
#14 0x00007ffff7764b95 in apr_pool_clear () from /usr/lib/libapr-1.so.0
#15 0x0000555555585e67 in main ()
More info about the environment:
Debian 7.11
perl-5.14.2 (same as system perl but built with perlbrew)
mod_perl2 (built manually)
How can I get to the root cause of this?
Math::Pari is not thread safe, so probably you are running under threaded MPM, try installing prefork model for Apache2. If you're on Debian/Ubuntu try this:
sudo apt-get install apache2-mpm-prefork

magento pdo_mysql extension is not installed in magento

I'm getting this error after moving the application to another host. It's working locally, without any problems, but the issue started after moving to the webhost. Please tell me what I'm doing wrong.
pdo_mysql extension is not installed
Trace:
#0 D:\Hosting\11486590\html\shopping\magento\lib\Zend\Db\Adapter\Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#1 D:\Hosting\11486590\html\shopping\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#2 D:\Hosting\11486590\html\shopping\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#3 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#4 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#5 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#6 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#7 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#8 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Resource\Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#9 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Cache.php(455): Mage_Core_Model_Resource_Cache->getAllOptions()
#10 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Cache.php(497): Mage_Core_Model_Cache->_initOptions()
#11 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\App.php(1183): Mage_Core_Model_Cache->canUse('config')
#12 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Config.php(414): Mage_Core_Model_App->useCache('config')
#13 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#14 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\App.php(413): Mage_Core_Model_Config->loadModulesCache()
#15 D:\Hosting\11486590\html\shopping\magento\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
#16 D:\Hosting\11486590\html\shopping\magento\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#17 D:\Hosting\11486590\html\shopping\magento\index.php(87): Mage::run('', 'store')
#18 {main}
Check of your server has the pdo_mysql extension installed.
Create a file info.php and in it write <?php phpinfo() ?>
access the file with your browser and search for "pdo"
if not found install it or ask your server administrator to install it for you