无法 运行 sidekiq 获取 "No module named 'pandas'"
Unable to run sidekiq getting "No module named 'pandas'"
我正在使用 Ruby 版本 "ruby 2.5.1"。我的 Ruby on Rails 应用程序失败并出现以下错误,即使 pandas 安装在我的机器上。 pandas (0.24.2) 和 bundler (2.0.1, default: 1.16.2) 安装在我的机器上。这里有什么问题,我该如何解决这个问题?
$bundle exec sidekiq
There was an error while trying to load the gem 'pandas'.
Gem Load Error is: <class 'ModuleNotFoundError'>: No module named 'pandas'
Backtrace for gem load error is:
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/pycall-1.2.1/lib/pycall.rb:62:in `import_module'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/pycall-1.2.1/lib/pycall.rb:62:in `import_module'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/pandas-0.3.1/lib/pandas.rb:4:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
/home/user/work/projects/myapp/config/application.rb:18:in `<top (required)>'
/home/user/work/projects/myapp/config/environment.rb:2:in `require_relative'
/home/user/work/projects/myapp/config/environment.rb:2:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `require'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `boot_system'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:46:in `run'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/bin/sidekiq:12:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `load'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/ruby_executable_hooks:24:in `eval'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/ruby_executable_hooks:24:in `<main>'
Bundler Error Backtrace:
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:80:in `block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
/home/user/work/projects/myapp/config/application.rb:18:in `<top (required)>'
/home/user/work/projects/myapp/config/environment.rb:2:in `require_relative'
/home/user/work/projects/myapp/config/environment.rb:2:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `require'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `boot_system'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:46:in `run'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/bin/sidekiq:12:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `load'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `<main>'
上述错误在安装 python3-pandas
后得到解决
apt-get install python3-pandas
我正在使用 Ruby 版本 "ruby 2.5.1"。我的 Ruby on Rails 应用程序失败并出现以下错误,即使 pandas 安装在我的机器上。 pandas (0.24.2) 和 bundler (2.0.1, default: 1.16.2) 安装在我的机器上。这里有什么问题,我该如何解决这个问题?
$bundle exec sidekiq
There was an error while trying to load the gem 'pandas'.
Gem Load Error is: <class 'ModuleNotFoundError'>: No module named 'pandas'
Backtrace for gem load error is:
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/pycall-1.2.1/lib/pycall.rb:62:in `import_module'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/pycall-1.2.1/lib/pycall.rb:62:in `import_module'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/pandas-0.3.1/lib/pandas.rb:4:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
/home/user/work/projects/myapp/config/application.rb:18:in `<top (required)>'
/home/user/work/projects/myapp/config/environment.rb:2:in `require_relative'
/home/user/work/projects/myapp/config/environment.rb:2:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `require'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `boot_system'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:46:in `run'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/bin/sidekiq:12:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `load'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `<main>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/ruby_executable_hooks:24:in `eval'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/ruby_executable_hooks:24:in `<main>'
Bundler Error Backtrace:
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:80:in `block (2 levels) in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
/home/user/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
/home/user/work/projects/myapp/config/application.rb:18:in `<top (required)>'
/home/user/work/projects/myapp/config/environment.rb:2:in `require_relative'
/home/user/work/projects/myapp/config/environment.rb:2:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `require'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:288:in `boot_system'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/lib/sidekiq/cli.rb:46:in `run'
/home/user/.rvm/gems/ruby-2.5.1@myapp/gems/sidekiq-5.2.5/bin/sidekiq:12:in `<top (required)>'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `load'
/home/user/.rvm/gems/ruby-2.5.1@myapp/bin/sidekiq:23:in `<main>'
上述错误在安装 python3-pandas
后得到解决apt-get install python3-pandas