packages

Can I use __init__.py to define global variables?

风格不统一 提交于 2019-12-17 08:07:11
问题 I want to define a constant that should be available in all of the submodules of a package. I've thought that the best place would be in in the __init__.py file of the root package. But I don't know how to do this. Suppose I have a few subpackages and each with several modules. How can I access that variable from these modules? Of course, if this is totally wrong, and there is a better alternative, I'd like to know it. 回答1: You should be able to put them in __init__.py . This is done all the

No RTools compatible with R version 3.5.0 was found

橙三吉。 提交于 2019-12-17 07:30:38
问题 I had problems installing data.table for R version 3.5.0, and was advised to check that RTools was properly installed. After installing RTools 3.5 (this seems to be the latest) I typed find_rtools(T) I got the following message: WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 3.5.0 was found. (Only the following incompatible version(s) of Rtools were found:3.4,3.5) Please download and install the appropriate version of Rtools from http://cran.r

How do YOU manage Perl modules when using a package manager?

落花浮王杯 提交于 2019-12-17 05:50:28
问题 A recent question here on SO got me thinking. On most Linux distributions that I tried, some Perl modules would be available through the package manager. Others, of course, not. For quite a while I would use my package manager whenever I needed to install some CPAN module to find out whether a package was available or not and to install it when it was. The obvious advantage is that you get your modules updated whenever a new version of the package becomes available. However, you get in

readRDS(file) in R

我的未来我决定 提交于 2019-12-17 05:02:49
问题 Whenever I try to install a package in R, I get the following error: Error in readRDS(file) : unknown input format This just started occurring after I had a system crash. I am running 32 bit R 2.13.0 under windows 7. I tried removing and re-installing R, but continue to get the error. Is there any way I can fix this without deleting everything (i.e. all the packages I've installed) and starting over? Thanks 回答1: These are suggestions I have come across: Delete your .Rhistory and .RData files

Where does R store packages?

久未见 提交于 2019-12-17 04:10:12
问题 The install.packages() function in R is the automatic unzipping utility that gets and install packages in R. How do I find out what directory R has chosen to store packages? How can I change the directory in which R stores and accesses packages? 回答1: The install.packages command looks through the .libPaths variable. Here's what mine defaults to on OSX: > .libPaths() [1] "/Library/Frameworks/R.framework/Resources/library" I don't install packages there by default, I prefer to have them

Check for installed packages before running install.packages() [duplicate]

泄露秘密 提交于 2019-12-17 03:50:14
问题 This question already has answers here : Elegant way to check for missing packages and install them? (27 answers) Closed 2 years ago . I have an R script that is shared with several users on different computers. One of its lines contains the install.packages("xtable") command. The problem is that every time someone runs the script, R spends a great deal of time apparently reinstalling the package (it actually does take some time, since the real case has vector of several packages). How can I

List all the modules that are part of a python package?

谁说我不能喝 提交于 2019-12-17 03:23:40
问题 Is there a straightforward way to find all the modules that are part of a python package? I've found this old discussion, which is not really conclusive, but I'd love to have a definite answer before I roll out my own solution based on os.listdir(). 回答1: Yes, you want something based on pkgutil or similar -- this way you can treat all packages alike regardless if they are in eggs or zips or so (where os.listdir won't help). import pkgutil # this is the package we are inspecting -- for example

Help with packages in java - import does not work

橙三吉。 提交于 2019-12-17 03:10:06
问题 I'm a C++ developer - not a java developer, but have to get this code working... I have 2 public classes that will be used by another product. I used the package directive in each of the java files. package com.company.thing; class MyClass ... When I try to compile a test app that uses that I add import com.company.thing.*; The javac compiler fails with errors about com.company does not exist. (even if I compile it in the same directory as the class files I just made a package of) I am sure I

yum 重新安装 卸载安装

橙三吉。 提交于 2019-12-17 03:03:45
CentOS 安装 yum 原 leeyi 发布于 2018/05/21 16:07 CentOS yum 【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 国内的yum仓库 http://mirrors.163.com/centos/7/os/x86_64/Packages/ http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/ CentOS7 安装yum 下载软件,文件版本可能有变化,根据列表里面进行下载 yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-3.4.3-132.el7.centos.0.1.noarch.rpm python-iniparse-0.4-9.el7.noarch.rpm 安装 python-iniparse rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm 安装 yum rpm -ivh --force yum-3.4.3-132.el7.centos.0.1.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin

How do I remove packages installed with Python's easy_install?

我只是一个虾纸丫 提交于 2019-12-17 01:19:10
问题 Python's easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing installed packages. What is the best way of finding out what's installed, and what is the preferred way of removing installed packages? Are there any files that need to be updated if I remove packages manually (e.g. by rm /usr/local/lib/python2.6/dist-packages/my_installed_pkg.egg or similar)? 回答1